News for hackers. Stuff that matters.
Re:The joy of max() by gerdesj on Friday March 30, 2018 @08:16PM (#16720867)
Yes it is easily fixed but this is a lack of attention to detail in a fundamental area. I would imagine that many, many people have seen that code at some point and yet have not bothered to fix up a glaringly obvious formatting error. That may say more about people than the quality of the code but it looks awful to an outsider (like me).

That chunk of code is one of the fundamental building blocks of C++. When presented as exhibit A it should look good. To an outsider that sort of thing looks bad, even if the presented thing is correct the silly error will be obsessed over - as here.

If something is important enough, and I think that C++ is one of those, then for $DEITYS sake fix the obvious stuff before having to be an apologist for it. A simple sed script run decades ago would have done that.

The reason I am labouring this point is that one day it wont be a discussion on HN debating this sort of bollocks but something involving lots of dosh. If S&M ever realised what source code really looked like - they'd have a fit. The world turns ...

Re:The joy of max() by tedunangst on Saturday March 31, 2018 @12:22AM (#16721710)
I'm going to have to disagree that a missing space in a comment is a fundamental flaw.
Re:The joy of max() by wruza on Saturday March 31, 2018 @10:53AM (#16723537)
Argh, I deserve my portion of lashes, but it is so clearly standing in my experience: most coders who don’t care of syntactical purity like formatting, indenting, consistency, meaningfulness etc. — they have less awareness and make more errors than those who do. It is not a strict rule, but a sign of weakness in that regard.

  }
  int foo(){
    for(x=1; x<len*2;x++){//over 2 array len
    ...(no empty lines for next hour)
I know I’m clinical perfectionist, but try to see it behind my complaint. Our brain can process only few things in parallel. If you overload it with parsing and do not provide hints like grouping and/or formatting, you occupy a couple of threads for a complete bs. As if programming was not one of the hardest things already.
Re:The joy of max() by kcanini on Saturday March 31, 2018 @12:07AM (#16721674)
Have you considered that it might be intentional?
Re:The joy of max() by setzer22 on Saturday March 31, 2018 @11:55AM (#16723780)
I agree. This looks to me like a commented out source line, not a comment that describes what comes next using a similar code expression.

It makes sense to drop the space before the start of the commented code because that way you can just delete the // and obtain the original source line.