"The Clean Code Talks -- Inheritance, Polymorphism, & Testing"
Google TechTalks · 2 位 HN 用户推荐 · 2022–2023
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: [link]
— Mr_P, 2022If the decisions are made as early as possible, they do not need to be littered throughout the code. The guts of the code can run without branches, performing the same operations every time, the output only modified through the construction graph. Of course, this is not a new idea: [link]
— tacitusarc, 2023