4 ms·
Yes, it's a very pragmatic way of improving a running system that you shouldn't break. Copy the old code to a new function/module/class. Keep the old code path
by jillesvangurp 7y ago
Yes, it's a very pragmatic way of improving a running system that you shouldn't break. Copy the old code to a new function/module/class. Keep the old code path in place but add a little feature flag or simply comment out the line that calls the old path and replace it with the new code path. Anything that allows you to easily switch between the old and new. Start fixing it. When everything is done, clean up by removing the old code.
This is a lighter weight version of creating a feature branch and attempting to keep that up to date or doing AB testing. That kind of thing typically involves a lot of project bureaucracy which can make a change more controversial. This way, until you are ready to enable the new path, there is no risk and you can keep on committing/merging changes. The only downside is temporary code clutter.