News for hackers. Stuff that matters.
Re:Avoid Else, Return Early (2013) by IshKebab on Monday March 26, 2018 @09:43AM (#16678768)
> The problem with this is maintaining comments.

That's like saying "the problem with healthcare is that it costs money". Of course comments can get out of date. The solution isn't to throw them out!

Re:Avoid Else, Return Early (2013) by YCode on Monday March 26, 2018 @09:50AM (#16678829)
"The problem with installing a roof on your house is one day it can be blown off."
Re:Avoid Else, Return Early (2013) by ajuc on Monday March 26, 2018 @09:49AM (#16678822)
There's no alternative for healthcare.

There's alternative to in-code comments answering the question "why" - it's commit messages. They can't be out of date.

Re:Avoid Else, Return Early (2013) by usrusr on Monday March 26, 2018 @11:18AM (#16679528)
But commit messages can easily get plowed under in some annoying "reformatted, I hate tabs/spaces" commit. I do like to see some "why" sprinkled in here and there that will survive those accidents. But I will nonetheless prefer blame output if it is still meaningful. Also, I enjoy a commit that removes redundant comments almost as much as one that removes redundant code.
Re:Avoid Else, Return Early (2013) by vk23 on Tuesday March 27, 2018 @11:08AM (#16689192)
You can either pass a commit id to git blame to see changes before the reformat happend or you can use git log like this:

git log -L0,10:file.txt

Re:Avoid Else, Return Early (2013) by TomMarius on Monday March 26, 2018 @03:52PM (#16681917)
What? So in my case I'm supposed to browse literally millions of commit messages in order to understand the code?