Re:Reducing technical debt by valuing comments as much as code
by sam0x17 on Wednesday February 01, 2023 @01:52AM
(#34607329)
Rails guy turned rustacean here. If I have a piece of code that looks gnarly, I'll write a comment above it explaining what it does. Elegance != readability always. This can often happen with complicated map/filter/etc chains (both in ruby and in rust!) that are compact but are complicated enough that your eyes glaze over when you read them. Anything eye-glaze-over-ey is probably worth a comment in my opinion.
Other times to comment include when there is some sort of dirty hack, TODO annotations, etc.
Other times to comment include when there is some sort of dirty hack, TODO annotations, etc.