News for hackers. Stuff that matters.
Re:Absolute truths I unlearned as junior developer by Gibbon1 on Friday June 07, 2019 @01:26PM (#20126805)
I write notes to my future self all the time.

Meta comment: This is bullshit and has problems with this that and the other thing. But to fix that I'd have to refactor this other module and I'm not going to do that now. And the other thing I'm drawing a blank.

Meta comment2: I don't think the code needs to do this here. But I can't prove it right now.

Meta comment3: We absolutely need to do this exactly as it is. Because otherwise bad thing happens, which you probably won't see until it hits production.

Meta comment4: This function name isn't correct. But I can't think of a name that is better.

Re:Absolute truths I unlearned as junior developer by vharuck on Friday June 07, 2019 @02:43PM (#20127490)
> Meta comment: This is bullshit

I used to worry about putting emotional blurbs in comments or commit messages, but I'm starting to see their value. A commit that starts "This ugly writing is to appease Roger, the editor obsessed with AP style" lets me know three things:

- Who asked for the change - The source of the content - The fact I disagree but still do it, so future me doesn't pick fights present me avoided

Of course, it could also mean "TODO: revert this commit the minute Roger retires."

Re:Absolute truths I unlearned as junior developer by reificator on Friday June 07, 2019 @03:40PM (#20127887)
That's less about emotion and more about context, which absolutely is important to capture. Links to tracking systems, and in more dysfunctional environments, quotes from emails and water cooler conversations can help a lot when going back in time. Generally I put those in the commit message whenever it makes sense, but sometimes it's better to put it in the actual comments themselves.

On the other hand, on the rare occasion that I've commented or committed something based on emotions, I've always regretted it. Granted they never caused problems for me, just a source of internal embarrassment. Still a good enough reason to be thoughtful about what emotions you express.

Re:Absolute truths I unlearned as junior developer by xsmasher on Tuesday June 11, 2019 @06:33PM (#20160105)
> Meta comment3: We absolutely need to do this exactly as it is. Because otherwise bad thing happens, which you probably won't see until it hits production.

This is the highest purpose that a comment can fulfill - telling why you are doing something that looks stupid.

Re:Absolute truths I unlearned as junior developer by polyterative on Friday June 07, 2019 @02:38PM (#20127442)
> This function name isn't correct

When dealing with articulate code I often rename the same thing multiple time while I understand it better/clarify it's purpose. Also I love how naming protects the purpose of a variable or method, mentally speaking

Re:Absolute truths I unlearned as junior developer by Drdrdrq on Friday June 07, 2019 @02:48PM (#20127519)
Couldn't agree more, except with meta comment 3 it is very important to describe the bad thing, so that future me knows if he can safely rewrite this or not.