Hacker News new | ask | show | jobs
by jan_g 1650 days ago
This approach works surprisingly well for most features, but care should be taken to remove those 'ifs' once the feature is stable/complete. Or, when implemented cleanly, they could also be left in place and used as long lived feature toggles that can be driven by configs (or user settings, ...).

The hairy part is when the new feature or change cuts across different parts of the code and then, given enough time, those 'ifs' pollute the codebase. Solution here is to be mindful of how the system grows, keeping things isolated and (perhaps counter-intuitive) favor duplication over shared logic/libraries. Regardless if it's about one big thing (i.e. monolith) or multiple small things (different projects even).