Hacker News new | ask | show | jobs
by LolNoGenerics 2802 days ago
Stop excessive branching if you can use feature flags.
2 comments

This is only a good idea if the things you're working on are isolatable "features", and you have an explicit process for garbage-collecting old feature flags. Otherwise the combinational explosion of possible flags kills your testing over time.
In addition to flags for functional changes, I'd say "design refactors to be incremental". It takes some care and thought, but almost every refactor I've seen can be framed as small steps that can each be immediately integrated into master. For example, when porting code from Python 2 to 3, you can change individual files to be 2/3 compatible until the whole codebase is, then flip the version without touching the source code, then get rid of 2/3 compatibility code. This tends to be safer and more reviewable than trying to rewrite the world on a separate long-lived branch and then land it all at once.