Hacker News new | ask | show | jobs
by xormapmap 953 days ago
The MISRA guidelines are awful.
1 comments

Could you be more specific? Are they badly written, or are they bad at achieving the intended purpose? Or is the purpose itself a bad idea?

And, whichever answer you give to that, why are they bad at it?

They are called "misery C" by people in the industry for a reason. They don't help with the safety all that much, but make a lot of code just fucking ugly.
Exactly. It reduced C to, almost, BASIC. Reduces available design patterns. Reduces available language features.

HOWEVER: having a MISRA-C LINT which is required to run on all code that makes it into an automobile is, ultimately, a good thing. Yes, the homogenization is ugly, but it does mean that classes of errors just can't occur.

The concept is great. There is also MISRA C++ of which I know almost nothing; is that any better?

MISRA C++ lags quite a bit relative to C++'s evolution over the last 20 years. It's closer to JSF C++ style guide.
I only wrote a little MISRA-C code, but IIRC we had a process to get waivers which was fairly reasonable I think.

BASIC, but with a human-driven process that bumps you back to C when necessary, with the understanding that multiple people look at the evil C-like code, actually seems like a fine language.

They're called "misery C" because it's an easy joke.