|
|
|
|
|
by mentos
1649 days ago
|
|
What is wrapping all new features in a #ifdef NEW_FEATURE //code #endif called? My process over the last 7 years working in game dev has slowly evolved to this where I'll ask a contractor to implement a feature on the main branch but make sure that it is completely toggleable via a #define NEW_FEATURE I thought I was pretty clever until I read an article on HN a few years ago that this is exactly what Google does lol |
|
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).