Hacker News new | ask | show | jobs
by nabbe23 1194 days ago
There are certainly times when comments are important and appropriate (C code is probably a great example) - but I find myself more often than not struggling to understand if an existing comment is truly up to date (commit history sometimes helps here, but not always.)

Instead of commenting, I try to split out functions or variables that specify the intent. Since it's code - it must be up to date.

An example from this article would be:

assert(ep.send == null); // TODO: support multiple senders

Turning into

assert(notMultipleSenders(ep.send));