News for hackers. Stuff that matters.
Re:Reducing technical debt by valuing comments as much as code by billforsternz on Tuesday January 31, 2023 @08:51PM (#34605262)
These are both terrible comments (IMHO) because they tantalise the reader (the coder knew why they did this mysterious thing!) but don't actually really explain why this is necessary or how this mysterious thing actually addresses the messy reality involved. The problem might just be that it's an unrealistic example.
Re:Reducing technical debt by valuing comments as much as code by nydev on Tuesday January 31, 2023 @11:03PM (#34606191)
Could be elaborated but this is 1000x better than nothing. The reader can look up what's unusual with enough hints from this comment.
Re:Reducing technical debt by valuing comments as much as code by mbesto on Tuesday January 31, 2023 @11:09PM (#34606228)
If you're going to call something terrible, it's a little more productive to offer a suggestion for something better.
Re:Reducing technical debt by valuing comments as much as code by billforsternz on Tuesday January 31, 2023 @11:54PM (#34606536)
Okay instead of

# Call foo_bar only on the 4th loop iteration to handle the weirdness of calculating taxes for California

# Call foo_bar only on the 4th iteration because in California widget tax # (1st iteration) doesn't apply at all, foo tax (2nd iter.) only applies # for B2B transactions (this is not one), bar tax (3rd iter.) only applies # for alcohol and this subsystem is not called for alcohol sales. But VAT # (4th iteration) does apply.

Re:Reducing technical debt by valuing comments as much as code by billforsternz on Wednesday February 01, 2023 @12:51AM (#34606953)
HN hasn't respected my line breaks.
Re:Reducing technical debt by valuing comments as much as code by azemetre on Sunday February 05, 2023 @12:29PM (#34666718)
I believe you need to have multiple line breaks between lines, I also appreciate the comment. I originally agreed with the other poster, but your comment is way better. Especially for having no context :D