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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Speaking of coding out of spite, is nobody going to mention that his C code features a
struct
with over 20 fields in it?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.
That's not uncommon, is it?
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.
You can tell there ought to be substructures because he used comments to label the different groups. That's a code smell right there.
Agreed
Yeah that's what I usually do, as long as it's passed by reference there isn't anything too bad here.
It is spite coding though.
He probably has a bunch of gotos too.
That's the
State
struct. Globally accessible, I'd bet