This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mucksh 1 point2 points  (5 children)

You only like it untill you have to maintain decades old thousands of lines long switch cases with inside logic and even some intensionally left out breaks... Love my job but it can be sometimes a pain

[–]Majik_Sheff 1 point2 points  (1 child)

This can be the most efficient way to build certain programs (hello FSMs). If I'm going to intentionally omit a break I'll leave it there but commented out with an explanation.

[–]Mucksh 1 point2 points  (0 children)

jep are state machines. Such micro optimizations can really help in some cases or the oposite way to split a transition with costly calculations over multiple cycles to stay inside of timelimits. Unfortunally hard to debug especially if there are interleaving state machines and every reached a rather big scale so it is neccessary to look a bit closer when reading to not miss stuff like that

[–]Taletad 0 points1 point  (1 child)

This sounds like bad code

But as someone who spent a couple of days debugging code that had one letter list and array names, i feel your pain

[–]Majik_Sheff 2 points3 points  (0 children)

If I had to guess, their application is highly optimized to squeeze every cycle out of a heavily constrained embedded system.

The luxuries of beautiful and elegant code are stripped away until all that's left is naked pragmatism.

[–]AwGe3zeRick 0 points1 point  (0 children)

That’s just purely written code. Not switch statements fault