This is just how people used to write code when everything was written in C. Depending on when it was written, I don't consider this bad at all, but I would reject the hell out of something like it in a code review at work and tell the author it's not the '80s anymore.
I dunno hey. C devs are normally well paid Unicorns, they normally over 40 already. Not that many bothered to learn it as a profession. So I am fairly certain that in an hour or 2 they will get the flow and be able to extend it. Sure its not pretty, sure it uses goto statements, but honestly that was only deprecated in object orientated languages, so I wouldn't stress too much. This looks like a good terminal app and this looks like ok command line parsing ok for what it does. There is enough structure put in by the original dev for the intent to be clear. Its literally a form of artwork. Beauty is in the eye of the beholder as they say
I'm guessing i would be uninitialized if it skips over that part, which might be bad when it reached the jump instruction to return to the top and check i, but it looks like it will always hit a break or return, so it should be fine.
I see goto start; a couple of places, but I don't see start: anywhere.
95
u/Sure-Opportunity6247 Apr 25 '26
Must be one of these „Stdlib is all you need“-zealots.
48
u/richardathome Apr 25 '26
Whoever wrote this hates their co-workers and themselves. It's a cry for help.
34
u/shponglespore Apr 25 '26 edited Apr 25 '26
This is just how people used to write code when everything was written in C. Depending on when it was written, I don't consider this bad at all, but I would reject the hell out of something like it in a code review at work and tell the author it's not the '80s anymore.
62
u/Ambivalent-Mammal Apr 25 '26
Hiding the true length of the code by expanding to the side lacks honor.
56
u/mss-cyclist Apr 25 '26
The formatting is an assault on my eyes
14
u/beatitmate Apr 25 '26
Yikes
10
u/TheMazerFaker Apr 25 '26
That's a masterpiece
10
u/veritron Apr 25 '26
Either the code was written in the 80's or the code was written by a scientist.
2
u/domusvita Apr 25 '26
I like that font tho
4
u/Snudget Apr 25 '26
Most sane C developer:
13
u/sens- Apr 25 '26
Ignoring absolutely everything even remotely related to programming, I gotta say the shape of this code is aesthetically pleasing.
Giving it any technical thought, it is shockingly disgusting, comparable with 4th degree burns photos.
Overall interesting piece of art.
2
u/Calloused_Samurai Apr 25 '26
Wow! Garbage!
2
u/UltimatePeace05 Apr 26 '26
Could be worse. Could be OO ¯_(ツ)_/¯
2
u/darksteelsteed Apr 25 '26
Imho nothing wrong with it as long as it works. Ship it !
1
u/_____rs Apr 25 '26
Goto branches into the middle of a for loop? Is that even legal?
1
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” Apr 26 '26
How many different libraries are there for this? I just know about the GNU one. GNU getopt I think.
1
u/yjlom Apr 25 '26
The formatting is terrible, and there's missing error handling, but otherwise what's wrong?
1
u/Spyromaniac666 Apr 26 '26
magnificent use of the comma operator
1
u/conundorum Apr 27 '26
Duff's Device, eat your heart out.
0
u/[deleted] Apr 26 '26
[deleted] — view deleted comment