this post was submitted on 10 Jul 2025
875 points (99.8% liked)

Programmer Humor

24932 readers
1270 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] dejected_warp_core@piefed.world 32 points 1 day ago (3 children)

Speaking of coding out of spite, is nobody going to mention that his C code features a struct with over 20 fields in it?

[–] calcopiritus@lemmy.world 35 points 1 day ago

Sometimes you can't not have a god class (struct in this case). When doing UI specifically, I always end up with one.

You can try using encapsulation to reduce the amount of fields technically, but in the end it's the same amount of information in a single god class.

[–] wise_pancake@lemmy.ca 17 points 1 day ago* (last edited 1 day ago) (1 children)
[–] qqq@lemmy.world 9 points 1 day ago* (last edited 1 day ago) (3 children)

Not really, but I'd probably try to organize those into sub structures where it made sense. A data structure holding the UI state and FFT data all flat is kinda messy imo since it becomes unclear what is actually required where.

[–] grue@lemmy.world 23 points 1 day ago (1 children)

You can tell there ought to be substructures because he used comments to label the different groups. That's a code smell right there.

[–] qqq@lemmy.world 2 points 1 day ago
[–] wise_pancake@lemmy.ca 2 points 1 day ago

Yeah that's what I usually do, as long as it's passed by reference there isn't anything too bad here.

[–] DrunkEngineer@lemmy.world 2 points 19 hours ago

It is spite coding though.

He probably has a bunch of gotos too.

[–] four@lemmy.zip 8 points 1 day ago

That's the State struct. Globally accessible, I'd bet