257m@lemmy.ml to Programming@programming.dev · 2 years agoWhat are your programming hot takes?message-squaremessage-square29linkfedilinkarrow-up10arrow-down10
arrow-up10arrow-down1message-squareWhat are your programming hot takes?257m@lemmy.ml to Programming@programming.dev · 2 years agomessage-square29linkfedilink
minus-squareMajorHavoc@lemmy.worldlinkfedilinkarrow-up1·2 years agoThere’s no such thing as self documenting code, unless every method and variable name has the word “because” in it. Anyone can read what the code does. The comments are there to answer why it does what it does the way it does. Why is invariably lost to time, if it’s not committed to a comment here and there.
minus-squarefkn@lemmy.worldlinkfedilinkarrow-up0arrow-down1·2 years agoThis is a pretty ridiculous position to take but if you believe it then I’m glad you write the comments you do. There is an argument that commenting on the lack of expected code is valuable for this reason, but it certainly isn’t true in all situations.
There’s no such thing as self documenting code, unless every method and variable name has the word “because” in it.
Anyone can read what the code does. The comments are there to answer why it does what it does the way it does.
Why is invariably lost to time, if it’s not committed to a comment here and there.
This is a pretty ridiculous position to take but if you believe it then I’m glad you write the comments you do.
There is an argument that commenting on the lack of expected code is valuable for this reason, but it certainly isn’t true in all situations.