Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Handling deferred code

A bit of functionality that has been mostly implemented has been shelved until a future development phase. The code is not wanted in the current phase, however it will be needed later, so simply removing it isn't an attractive option. Finishing the code is also considered an unattractive option. I'm trying to work out the best way of putting this functionality into cold storage without:

  • leaving clutter in the source files
  • removing it altogether (as per the wishes of my team)

I don't immediately see the best way of handling this "temporarily" redundant code. Part of me just wants to just tag the code base and rip out the offending code. My rationale for this is:

  • when (and if!) we ever go back to this functionality it'll likely need a fair few changes anyway as everything else would have moved on
  • littering the code with (what can only become more) broken / incomplete code wrapped in #if 0 feels wrong wrong wrong
  • having a tagged point in source control which has context is much more useful should this functionality be reimplemented later

Is there anything I'm missing here?

like image 496
Konrad Avatar asked Nov 26 '25 10:11

Konrad


1 Answers

I would create a branch pointing to revision with unwanted code, continue development in master and merge this two branches later, when this code becomes useful again.

Excuse me using git vocabulary, this concept can be easily ported to other VCSes.

like image 130
Dr McKay Avatar answered Nov 29 '25 00:11

Dr McKay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!