Post #3966196
2026-07-20 18:10 UTC
Replies (1)
-
@Nalivai@lemmy.world 2026-07-20 18:41
Yeah, it’s not optimal, I don’t think anyone argues that it is. It has a bunch of ways to shot yourself in the foot, no questions about that, people were writing books about that for decades. But also, a lot of that non-optimality is what gives it advantage. Well, that and enormous amount of legacy code and expertise. Sometimes you need to pass around raw pointers without caring about memory ownership, and for that situation it’s optimal. I’m glad you have your mandatory curly brackets, but sometimes I just want my microcontroller to blink an LED and for that I’m in turn glad that I can be as quick and dirty as my filthy mind allows me. And for serious projects we’re all MISRA compliant anyway, and it mandates curly brackets for ifs and proper cases for switch.