News for hackers. Stuff that matters.
Re:A Short Cautionary Tale About Refactoring by cjblomqvist on Sunday March 21, 2021 @01:35AM (#26528342)
Imo the big takeaway from the story is that the code probably needed an explanation (aka comment) to prevent others for making the same faulty assumption that the images were inlined for no reason and wasting the same amount of time "refactoring".

In other words, it could/needed still to be improved for better maintainability, not just in the obvious way (Chesterton's fence, as mentioned by another commenter)

Re:A Short Cautionary Tale About Refactoring by rawoke083600 on Sunday March 21, 2021 @04:35AM (#26528999)
Yea, there are many schools of thought on what/how to comment "properly". But I have found this simple rule to cover most of the cases, it's not perfect but better than most:

"The code is the HOW, the comments are the WHY"

Re:A Short Cautionary Tale About Refactoring by TeMPOraL on Sunday March 21, 2021 @06:16AM (#26529385)
That's a good rule of thumb. Personally, I also add comments for the HOWs that may be relevant to users of a function/class, that cannot be easily expressed in code in the function signature or class declaration.

Things like, "relative ordering of results is not preserved", or "this function is O(n^3)".