Live data from Hacker News

Good code is like a love letter to the next developer who will maintain it

addyosmani.com

21–30 of 274 posts

Re: Good code is like a love letter to the next developer who will maintain it

#21
1) "Code sober, debug drunk"

It's harder to read the code than to write it so if you can barely comprehend the thing you just wrote, you probably won't understand it in the future: https://sonnet.io/posts/code-sober-debug-drunk/

2) I think it's more like speaking with ghosts (including a spoiler for The Sixth Sense):

https://sonnet.io/posts/emotive-conjugation/

Re: Good code is like a love letter to the next developer who will maintain it

#22
post #15

In my opinion, good code is like a Brita filter. It does its job, will one day need to be replaced, and it should be easy to replace. More importantly: metaphors are not a healthy way to understand an idea. Ideas are more nuanced than a metaphor could possibly account for. Abstaining from metaphors might not make for a catchy headline though.

Metaphors are also ways of communicating ideas. A good metaphor is as simple or as complicated as it needs to be in illustrating a new concept

Re: Good code is like a love letter to the next developer who will maintain it

#24
post #12

Sorry next developer, I'm on a tight deadline, used to love this craft, now I just do what the product people tell me to get a nice paycheck.

Yep. Yesterday I ran into a job opening asking for "Java developer who delivers 3x faster than the other developers" in one of the bullet points. It's such a weird point to emphasize that you want speed with no concern to trade-offs, and the maintainability and scalability of the codebase will be the first victims sooner or later.

Sounds like they're looking for a person who'll work 3x faster than the rest of the team by taking shortcuts and slowing everyone else down.

Re: Good code is like a love letter to the next developer who will maintain it

#25
post #3

And remember, the next maintainer could very well be you.

Yeah, it's humbling enough when you are reviewing some old code and thinking "what idiot wrote this" only to git blame and realize it was you. What's even more jarring when you find some code, surprised the capability/feature even exists, then git blame and realize again it was you (this time hopefully with a pat on your own back because of how well it's written). Yes this has happened to me.

I recently had the opposite experience: encountered some code from 2017(!!!) that was really solid. Few "silly" things but the important stuff was there.

I realized that when I did that project I "had the time to care" which is not the case lately!

Re: Good code is like a love letter to the next developer who will maintain it

#29
post #15

In my opinion, good code is like a Brita filter. It does its job, will one day need to be replaced, and it should be easy to replace. More importantly: metaphors are not a healthy way to understand an idea. Ideas are more nuanced than a metaphor could possibly account for. Abstaining from metaphors might not make for a catchy headline though.

In my opinion, metaphors are like a picture. They can communicate vast amounts of information very quickly but can have inaccuracies.

You should expect some additional nuance when receiving a metaphor.

Re: Good code is like a love letter to the next developer who will maintain it

#30
Good infrastructure is too. I had a colleague deploy the power whip for the last available rack position on his way out the door.

Years later when I desperately needed that rack to keep the site up I was able to roll it in and light it up without waiting 6weeks for an electrician change request.

He saved my bacon by thinking ahead. It was a gift he gave me, never mentioned and was not around to receive thanks for.

I aspire to be more like him in everything I do.

Post reply on HN