top | item 36808387

(no title)

henry_bone | 2 years ago

"At the start of my book, Learning JavaScript Design Patterns, I say "good code is like a love letter to the next developer who will maintain it". It is an intimate correspondence, from one developer to another, spanning time and space."

Seriously?!

It's simple. It's a matter of respect, and treating others as you would like to be treated. It's no fun trying to figure out the "why?" of some code you've inherited responsibility for. It can be frustrating and time consuming.

So why would you put others through it. Make the code and the reasoning behind it as clear to the next dev as possible. Explain it with comments. Refer to issue links. Make it so that there's minimal - preferably zero - unnecessary digging for the next poor soul who'll work on it.

discuss

order

midoridensha|2 years ago

>So why would you put others through it.

Because I've found there's a bunch of developers who apparently think it is fun to figure out the "why?", and they code accordingly.

>So why would you put others through it.

Because they think their code is "self documenting" and perfect and that anyone that can't immediately understand their code is too dumb to be working with it.

>Explain it with comments.

We just had a discussion here in the last week or two where people were actually saying that comments are completely useless and should never be used.

>Make it so that there's minimal - preferably zero - unnecessary digging for the next poor soul who'll work on it.

Sounds great to me, but in my experience it's a minority of developers who agree with you. It makes working on others' codebases very frustrating in most cases.