Skip to content
DevMeme
3847 of 7590
CodeQuality Post #4190 · source on Telegram

Why reading legacy code feels messier than rewriting from scratch

Description

The meme has a white background with a large block of black text at the top that reads: “There’s a reason that programmers always want to throw away old code and start over: they think the old code is a mess. They are probably wrong. The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming: It’s harder to read code than to write it.” Beneath the quote is a blurred image of a person’s face (identity not discernible), overlaid on a light-gray panel. In the bottom-left corner, a small white caption says “joelonsoftware,” referencing Joel Spolsky’s famous blog post about rewriting code, and a tiny share icon appears at the bottom-right. The visual emphasizes the cognitive burden of deciphering unfamiliar codebases versus the seductive ease of starting anew, highlighting themes of legacy systems, refactoring decisions, and the ongoing struggle for code quality in software engineering

Comments

22
Anonymous ★ Top Pick Reading the 200 KLOC monolith feels like archaeology with grep and hope, but rewriting it just guarantees future interns inherit two monoliths - and Joel Spolsky’s ghost at every stand-up
  1. Anonymous ★ Top Pick

    Reading the 200 KLOC monolith feels like archaeology with grep and hope, but rewriting it just guarantees future interns inherit two monoliths - and Joel Spolsky’s ghost at every stand-up

  2. Anonymous

    After 20 years in the industry, I've learned that 'legacy code' is just code written by someone who understood the business requirements better than you do, but documented them worse than you would have

  3. Anonymous

    Every rewrite starts with 'the old code is unreadable' and ends with new code that's unreadable plus the old bugs, reimplemented from scratch

  4. Anonymous

    Ah yes, the classic Joel Spolsky wisdom hitting different after you've been the architect of your third 'temporary' system that's now running critical infrastructure for 8 years. Every senior engineer eventually learns this the hard way: that 'spaghetti code' you inherited isn't actually worse than what you'd write - you just don't have the 10,000 hours of context about why that seemingly insane conditional exists. Spoiler: it's handling the edge case from the client who threatened to leave in 2015, and yes, they're still your biggest customer

  5. Anonymous

    Joel's law decoded: You're a genius writing it, an idiot reading it - both the same dev, months apart

  6. Anonymous

    "Let's rewrite it" is dev-speak for "reading is hard; let's delete the undocumented invariants and let prod teach them back to us."

  7. Anonymous

    “Let’s rewrite it” is architect-speak for “let’s delete a decade of encoded edge cases and call it velocity.”

  8. @flex_ape 4y

    Where the meme

  9. @karim_mahyari 4y

    The meme's in your commits

  10. @niklashh 4y

    disagee

  11. @QutePoet 4y

    Just make much comments in code so everyone can understand your code. It's good to comment at least what a block of code do. And it's superb to comment almost every line of code. That's what I do. I also mark ifs and cycles start and finish with comments. Code must look like a book, not like a puzzle.

    1. @captain_gaga 4y

      Overcommenting is as bad, as no comments at all imo.

    2. Deleted Account 4y

      ideally, code should not have comments and be self-explanatory

      1. Deleted Account 4y

        Bruh...

        1. @RiedleroD 4y

          the code is said to be genius, not necessarily good

    3. @sashakity 4y

      >it's superb to comment almost every line of code jesus christ

    4. @saniel42 4y

      Oh yes, famous Function SquareRoot Comment: returns square root

      1. @picolino 4y

        Oh, seems like you kind of forget to comment parameters of that function

  12. @ozalexo 4y

    My internal monkey says that code is hard to read only if this code was written by another monkeys.

  13. @cptnBoku 4y

    If it was hard to write it should be hard to read

  14. @digital_insanity 4y

    Those who have ever wanted to rewrite complex projects or their parts never ACTUALLY had experience rewriting tons of legacy code

  15. Deleted Account 4y

    And comments can lie

Use J and K for navigation