3 ms·
Comments aren't outdated. Obvious code doesn't need to be commented, and code should be written to be obvious where possible. But where it's not possible to wr
by justinludwig 3y ago
Comments aren't outdated. Obvious code doesn't need to be commented, and code should be written to be obvious where possible.
But where it's not possible to write obvious code, it should have comments explaining _why_ the code is doing what it's doing. Usually this will include references to external sources like issue trackers and software-design documents, or at least to other parts of the code.
Also, really hairy bits of code (like multi-page functions etc) often need comments just to explain what the heck it does (but in that case, it should also include an explanation of _why_ it's so hairy, and the ramifications to making changes to it).
_The Mythical Man-Month_ is still worth a read, although many of its insights that were super hot takes 50 years ago have been pretty much adopted into the mainstream.