News for hackers. Stuff that matters.
Re:Why Not Comments by steveBK123 on Tuesday September 10, 2024 @07:42PM (#41506777)
There's also the comments that tell you why the code does something obviously stupid but needs to continue replicating this stupid behavior because something else depends on it behaving this way.
Re:Why Not Comments by paulryanrogers on Tuesday September 10, 2024 @08:00PM (#41506888)
This is the way :mando:

If it's not answering why or at least providing a very concise how to very verbose code, then it's just adding noise

Re:Why Not Comments by saurik on Wednesday September 11, 2024 @02:25AM (#41508551)
That sounds like "explain[ing] why the code isn't written in another way" where the other way is "the way you are right now thinking it should be as you read this: the way that isn't obviously stupid".
Re:Why Not Comments by steveBK123 on Wednesday September 11, 2024 @07:14AM (#41510221)
I'm thinking less in "way the code is written" and more "the way the code works".

That is things like cases it doesn't support, or weird results in some cases.

One example is a shop I worked many years ago that had a function which did time conversion on date times without adjusting the date portion. Obviously, objectively, wrong.

However the callers to this function expected this errant behavior. Actually changing it to behave correctly would require a coordinated change. Putting that comment in place prevents a new hire from going "oh this is obviously wrong!" and fixing it, causing an outage.