I'm currently rewriting the heart, foundation, core module of my company, that's written with my own shitty legacy code that is old, is dirty, but somehow worked flawlessy during whole 4 years. I'm afraid.

  • 4
    ++ but real fear sets in when the rewrite is done and everything *appears* to work. But you KNOW you're not that good.
  • 3
    Can you wrap those old functions in unit tests and gather their supposed outputs and when you write new code, pass each new part through the same tests? Using them to validate the outputs are equal? Would that work for you?
  • 0
    @chrisalexthomas this is a great idea, but unfortunately the current code is a complete mess with functions responsible for more than 10 things at once. Fortunately, the module is a frontend one, so I can measure if it works by comparing the current behavior. It will be a messy process, but the new code will be way more maintainable!
  • 1
    @zourtney hahaha true story man. Never trust a code that works out of the box!
Add Comment