Re:Maybe comments should explain 'what' (2017)
by antonymoose on Sunday January 04, 2026 @07:33AM
(#46487348)
I always use “what” comments for regular expressions, in addition I provide examples of before and after transformations so that future developers know immediately what’s going on without having to first stop, context-switch, and decipher hieroglyphs.
[ Parent
| on HN ]
Re:Maybe comments should explain 'what' (2017)
by epgui on Sunday January 04, 2026 @10:04AM
(#46488614)
This is probably one of the best use cases for "what" comments... however in my opinion a much better way to go about this is to have example-based tests (and maybe a decent function name) serve as your documentation.