News for hackers. Stuff that matters.
Re:Flags Are a Code Smell (2014) by Mr_P on Saturday May 21, 2022 @10:18PM (#31464312)
It's not so much the existence of the flag, itself, but rather using an if-statement at the deepest-level of the call stack to conditionally modify behavior.

This talk gives a great overview of why boolean flags (rather, if-statements) can be a code smell: https://www.youtube.com/watch?v=4F72VULWFvc

OP's blogpost advocates for data-oriented design (e.g. Entity Component Systems) as a mechanism for avoiding this, whereas the talk I've linked advocates for OOP. Both mechanisms are equally valid (imho) and are inline with widely-adopted industry practices for software architecture.

Re:Flags Are a Code Smell (2014) by gentleman11 on Sunday May 22, 2022 @12:56AM (#31464994)
I second that video: I’ve watched it several times over the years. I still use flags and conditionals, but less of them these days, and it’s made my life a lot easier