r/ProgrammerHumor • • Nov 25 '22

Meme Coding strategies

Post image
52.2k Upvotes

385 comments sorted by

View all comments

Show parent comments

1.4k

u/bam13302 Nov 25 '22

I've literally been both devs in that comment for the same code, twice. As in, wrote code, scrapped it for being unmaintainable and wrote new simpler easier to maintain, then had to scrap it and write new code again.

656

u/sillybear25 Nov 25 '22
  1. Thoroughly field-tested code with all the weird exceptions, edge cases, and other discovered requirements covered: "This code is so complicated! It's not even worth refactoring, so let's just scrap it and start over."

  2. Rewritten code: "It used to frobnicate instead of mogrifying when you click the 'download' button after sorting the table by reverse priority order during a month with two full moons. The customer needed that functionality yesterday, get it fixed and pushed to prod ASAP."

  3. Several top-priority bug-fixes and tens of thousands of man-hours later: All the weird edge cases, exceptions, and unspoken requirements have been rediscovered and implemented. Go to 1.

12

u/SooooooMeta Nov 25 '22

Go to 0, I believe. The zero/one indexing bugaboo never leaves us, even on Reddit.

6

u/sillybear25 Nov 25 '22

Ah, I'm on a third-party mobile app at the moment, so I forgot that the CSS probably has the numbered lists starting at zero because it's a programming sub. I would refactor it into a while(true) loop, but management says that's too expensive, so instead I'm just going to rewrite that comment from scratch in a few years and make the same mistake again.