News for hackers. Stuff that matters.
Re:I’m a productive programmer with a memory of a fruit fly by andirk on Monday September 19, 2022 @11:34PM (#32907362)
Comments on non-trivial code is invaluable. I do it constantly and appreciate traversing previously made comments, especially when beyond short-term memory. Regexes, multi-conditionals, all those weird edge cases. How does any of that go "out of date"? As time progresses, comments become _more_ valuable, not less. What is the use case where comments are bothersome or out of date?
Re:I’m a productive programmer with a memory of a fruit fly by VBprogrammer on Tuesday September 20, 2022 @09:33AM (#32911439)
Comments about what something is doing are both the least useful and most likely to go out of date.

Comments about why something is happening are in my experience much more useful.

An example:

# Using an if / elif rather than a select here

Rather than:

# Use a large if / elif statement here due to a regression in TCL 8.4 which made select statements significantly slower. See GitHub.com/tcl-bugs.