18
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 20 Aug 2026
18 points (100.0% liked)
Programming
28208 readers
135 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 3 years ago
MODERATORS
I would use an enum. Booleans are bad, because they don't tell you what
truemeans. And specifically named functions are bad, because you cannot pass them through the codebase as data (without resorting to entirely functional patterns).I mean, your examples are in C, which has shit enums that are just integers, so at runtime you won't know either what a

1is without context.And I believe the compiler doesn't stop you either from passing a different enum or just an integer into a parameter with that enum as type.
But at least it'll be written in the code what you hope to get passed, so...