r/ProgrammerHumor • • Sep 23 '22

Refactoring "Just working solution ".

Post image
54.8k Upvotes

355 comments sorted by

View all comments

3.1k

u/TerriblyCoded Sep 23 '22

Past me: “Hahaha! I’M A GENIUS!”

Present me: “OH NO!”

313

u/omgFWTbear Sep 23 '22

I learned .. who was it, Knuth who said, “Never write code as clever as you can, because debugging is harder than coding, so …”

As many others, I received a full scholarship in my degree on that from the University of Hard Knocks, the School of Blood, Sweat, and Tears; later on, I shared this wisdom to my now-ex who started her career after me, she thought it was ridiculous to ever not be your cleverest.

As they say, you can lead a horse to water …

18

u/[deleted] Sep 23 '22

Always write code as if the next person is a murderous psychopath who knows where you live.

Usually that next person is me and I hate myself for it.

Seriously though I'll take code that is more verbose and self documenting over "clever" code any day of the week. If you think you're being clever when you're writing something it's time to do your due diligence to make sure your solution is something that is maintainable long term esp if you aren't going to be the one on the team maintaining things.