Refactoring Legacy Code (2014)
tiffnix.com
tiffnix.com
I'm not certain if it also applies to FotR but the MUD I worked on also had an incredibly failable persistence strategy involving a lot of flat files that were written to in sequence - weirdly it also had a rather impressive code hot-swap system that allowed the binary to be swapped out during execution so thankfully the system wasn't brought down that often.
* transition version control to Git
* Removed commented out blocks
* Add clang-format to the codebase
* remove support for old operating systems
* fix clang warnings and memory bugs
* reorganize sections of code changing behavior minimally
* add unit tests
* update compiler to clang++
* refactor and add new functionality
/* converted with f2c dec 2001 */
I had to to fix some buffer overflow and int overflow issues flagged by an automated scanner. 2000 line function with about 50 labels and gotos in there.
Working on it was actually kind of zen, it was just one file though, any more would’ve been unbearable.
YIKES. This strikes me as the kind of thing that happens when you don’t use version control.