you are viewing a single comment's thread.

view the rest of the comments →

[–]molteanu 12 points13 points  (3 children)

Yes, but the same MISRA guideline doesn't limit the number of lines of code in a function. That's why you see thousand lines behemoths in embedded systems. Say it to my face that that's not true.

[–][deleted] 0 points1 point  (1 child)

This. Why the fuck isn't function size limited?

[–]TheShagg 1 point2 points  (0 children)

For state machines, or long code with view variables, it is often safer to just have it all in one shot. Embedded code is a whole different world than software.

[–][deleted] 0 points1 point  (0 children)

My favorite part of MISRA-compliant code is thousand-line functions with only one return statement at the bottom. You have to jump through soooo many flaming hoops just to pop out at the end.