News for hackers. Stuff that matters.
Re:Please do not attempt to simplify this code by mdpopescu on Friday December 28, 2018 @02:52AM (#18775394)
I once spent two hours on figuring out why a log file wasn't being modified when there was an error. I knew the location of the file but it just wasn't showing that error.

Eventually I tracked down this line:

    // writes to the log file at c:\...\xyz.log
    AppendToLog(message);
Yeah, that was the correct path and everything, and yet the line wasn't executing!

Eventually I looked inside the AppendToLog method. It was writing to another file in a completely different path :)

That was when I stopped bothering to read comments. They always lie, and I couldn't even blame the programmer who changed the AppendToLog method -- the comment wasn't inside the method, it was on a call. I can't honestly expect someone who changes a method to look for all the places where that method is called and make sure any existing comments match the change.

Re:Please do not attempt to simplify this code by Karrot_Kream on Friday December 28, 2018 @05:28AM (#18775998)
Can't you modify the comment to improve overall hygiene instead of emerging with code nihilism?
Re:Please do not attempt to simplify this code by mdpopescu on Friday December 28, 2018 @06:12AM (#18776137)
By all means, feel free to improve that comment :)