Skip to content
DevMeme
3506 of 7590
Refactoring Post #3842 · source on Telegram

Refactoring a legacy codebase down to its essence

Description

This is a four-panel comic strip featuring two simple stick-figure characters. In the first panel, one character asks another who is sitting at a computer, 'WHAT ARE YOU DOING?'. In the second panel, the character at the computer replies with a smile, 'I REMOVED ALL THE BAD CODE FROM THE APP'. In the third panel, the first character asks, 'WHAT'S LEFT OF IT?'. The final panel shows the computer screen, which is now completely black except for the white text 'Hello world' and 'Press any key to continue...'. The joke is a cynical take on legacy codebases, suggesting that years of accumulated technical debt, poor practices, and convoluted logic have rendered the entire application unsalvageable. The only 'good' code left after the refactoring is the most basic program imaginable, a 'Hello, world!', implying the need for a complete rewrite. For senior engineers, it’s a humorous and relatable expression of the frustration felt when inheriting a project so riddled with problems that starting from scratch seems like the only viable option

Comments

16
Anonymous ★ Top Pick That's not a refactor; that's a `git reset --hard` to the initial commit
  1. Anonymous ★ Top Pick

    That's not a refactor; that's a `git reset --hard` to the initial commit

  2. Anonymous

    Quarter-end tech-debt audit: 1.8 M lines deleted, uptime improved, and it turns out our entire “domain model” was just System.out.println("Hello world"); wrapped in 47 microservices

  3. Anonymous

    After 15 years in the industry, you realize the only truly bug-free code is the code that doesn't exist - though management still expects it to pass all acceptance criteria and scale to a million users

  4. Anonymous

    When your aggressive refactoring strategy achieves 100% code coverage removal and you're left with the only program that's guaranteed to compile on the first try. At least the cyclomatic complexity is now O(1), and there are zero production bugs - because there's zero production code. Ship it

  5. Anonymous

    Removed the bad code and the app collapsed to Hello World - apparently our entire feature set was just side effects hiding in global state

  6. Anonymous

    After we paid down all the tech debt, the monolith achieved functional purity - main now just prints 'Hello world'

  7. Anonymous

    Refactored out all the bad code, achieving perfect architecture: a hello world monolith that scales to exactly zero features

  8. @kandiesky 4y

    Every code is a bad code if you code enough

    1. @vulpes_br 4y

      Every code is a bad code if you're sober

      1. @sylfn 4y

        Every code is a code

        1. dev_meme 4y

          .every()

    2. @RiedleroD 4y

      every code is bad code if you code

  9. @zherud 4y

    Working code = good code, Please don't touch it.

    1. @RiedleroD 4y

      is it working when it prints errors to stdout and logs everything to .log_verbose.txt?

      1. @RiedleroD 4y

        without clearing ofc

      2. @CcxCZ 4y

        Too complicated. Everything should just go to stdout. Put it under daemontools-style supervision and attach s6-log as output handler. No need to reinvent the wheel in-app badly.

Use J and K for navigation