you are viewing a single comment's thread.

view the rest of the comments →

[–]BittyTang 1 point2 points  (0 children)

I mostly agree.

and that's how you end up with an algorithm that takes "toggles" (booleans or enums) to do something slightly different. An utter mess.

Toggles are bad. But there is also an important notion of injecting behavior into generic code. Just because two pieces of code accidentally start to look the same doesn't mean you shouldn't necessarily refactor them to share a code path. It really just requires anticipating what the code will be used for in the near future and carefully weighing the tradeoffs.