I want to make some enhancements in some still-functional code that was written a long time ago, before the programming language it is written in grew in features. In theory, the whole project uses the up-to-date version of the language; however, this particular module (and in fact, many other modules) are still written in the older dialect.Should I:Not touch the parts of the code I dont have to touch, but write my patch making use of the new language features that make it easier to write the patch but are not used in analogous situations anywhere else in the module? (This is the solution Id intuitively choose.)Ignore the fact that years have passed, and reflect the style that is used in the rest of the code while writing my patch , effectively behaving as if I were doing the same task many years earlier? (This solution Id intuitively consider silly, but given the amount of fuss everyone who speaks about good code makes about keeping consistency at all costs, perhaps this is what I should do.)Update the whole module to use the newer language constructs and conventions? (This is probably the best solution, but might require lots of time & energy that could better be spent on a different task.)
Should older code be updated to use newer language constructs, or should outdated constructs be stuck with?
programming practices;maintenance