Slashdot Mirror


Linus Torvalds In Sweary Rant About Punctuation In Kernel Comments (theregister.co.uk)

An anonymous reader shares a report on The Register: Linus Torvalds has unleashed a sweary rant on the Linux Kernel Mailing List, labelling some members "brain-damaged" for their preferred method of punctuating comments. "Can we please get rid of the brain-damaged stupid networking comment syntax style, PLEASE?" the Linux Lord asked last Friday. "If the networking people cannot handle the pure awesomeness that is a balanced and symmetric traditional multi-line C style comments, then instead of the disgusting unbalanced crap that you guys use now, please just go all the way to the C++ mode."Torvalds despises the following two comment-punctuation styles (with his comments):/* This is disgusting drug-induced
* crap, and should die
*/
and:/* This is also very nasty
* and visually unbalanced */
Torvalds prefers the following two styles:/* This is a comment */ and:/*
* This is also a comment, but it can now be cleanly
* split over multiple lines
*/

293 of 523 comments (clear)

  1. Whether he's overall crazy or not... by Anonymous Coward · · Score: 5, Insightful

    ...I happen to agree with his stance on this particular issue.

    1. Re:Whether he's overall crazy or not... by RabidReindeer · · Score: 4, Insightful

      If nasty-looking comments were the worst offense in recent Linux releases, I'd be overjoyed.

    2. Re:Whether he's overall crazy or not... by Anonymous Coward · · Score: 1

      You forgot a space before Neatness, that's a cardinal sin.

    3. Re:Whether he's overall crazy or not... by Anonymous Coward · · Score: 1

      Me too.

      When doesn't Linus post a sweary rant about something?

    4. Re:Whether he's overall crazy or not... by HiThere · · Score: 1

      OK. I happen to disagree. But if a project has a coding standard, then you need to follow it anyway.

      As it happens, my preferred comment style matches one of the ones he disapproves of. I like to conserve vertical space, so I prefer:

      /** Title of the comment.
        * body of the comment.
        * body continued. */

      I don't plan on reading it there, though, I plan on using Doxygen to produce commented text, and not looking at the code again unless I need to modify it.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
    5. Re:Whether he's overall crazy or not... by tnk1 · · Score: 1

      I rather think that's part of his charm.

      I mean, its sort of funny to see someone with almost no accountability go off like that. It must have been like being lambasted by Steve Jobs. You know he's a dick, but its a good story and no one will actually think worse of you for it. Everyone knows that's just what Steve Jobs did.

      In this case, it's just what Linus does. There's no request for improvement that he can make which would not be improved by a sweary rant. It's not like the army of paid corporate developers developing his kernel for him can actually do anything about it.

      Now, all he has to do is get a car without a license place so he can start parking in handicapped parking spots and he can get to the same level of legendary unaccountablity.

    6. Re:Whether he's overall crazy or not... by hcs_$reboot · · Score: 5, Funny

      /* no comment */

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    7. Re:Whether he's overall crazy or not... by sl149q · · Score: 1

      Agreed, but I wouldn't go to the mat in a swearing contest over it.

    8. Re:Whether he's overall crazy or not... by Darinbob · · Score: 1

      Seriously, if you're a great programmer then you've got to have at least some degree of Obsessive Compulsive Disorder. C and OCD go hand in hand.

    9. Re:Whether he's overall crazy or not... by jellomizer · · Score: 1

      While I agree that is a better form of comments. To go on a rant about it for such a public figure is just wrong.
      If he is such a great programmer. He should be able to write a comment beuitifier to quickly fix the issue, than trying to corroborate with thousands of people who may have different aspect on comments.

      --
      If something is so important that you feel the need to post it on the internet... It probably isn't that important.
    10. Re: Whether he's overall crazy or not... by greenfruitsalad · · Score: 1

      what's wrong with that? it's by far the most pleasant code to read.

    11. Re:Whether he's overall crazy or not... by MrKaos · · Score: 1

      Seriously, if you're a great programmer then you've got to have at least some degree of Obsessive Compulsive Disorder. C and OCD go hand in hand.

      The only problem with the acronym for people with OCD is that it is not in alphabetical order.

      --
      My ism, it's full of beliefs.
    12. Re:Whether he's overall crazy or not... by MichaelSmith · · Score: 1

      I like his preferred style too but I am not going to waste my life arguing about it.

    13. Re:Whether he's overall crazy or not... by Big+Hairy+Ian · · Score: 1

      Just don't even get him started on indentation!

      --

      Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

    14. Re:Whether he's overall crazy or not... by WallyL · · Score: 2

      Mods, I need to report an empty post.

    15. Re:Whether he's overall crazy or not... by luis_a_espinal · · Score: 1

      OK. I happen to disagree. But if a project has a coding standard, then you need to follow it anyway.

      As it happens, my preferred comment style matches one of the ones he disapproves of. I like to conserve vertical space, so I prefer:

      /** Title of the comment. * body of the comment. * body continued. */

      I don't plan on reading it there, though, I plan on using Doxygen to produce commented text, and not looking at the code again unless I need to modify it.

      We seldom read our code. But if the code does something valuable (and/or is craptacular), others will. If no one seldom reads it, then it is either rock solid, or it has no value whatsoever.

    16. Re:Whether he's overall crazy or not... by HiThere · · Score: 1

      In a printout vertical white space is good (within limits). On a screen the total amount of vertical space is strongly constrained. So if I want to see much of the code, the vertical space need to be compacted. Not totally, I like a blank line before the start of each documentation comment and for punctuation within logical breaks in the routine, e.g. after major loops, but strongly. Designs that require lots of white space keep me from seeing enough code.

      Well, to be honest, I'd prefer it if my screen were taller rather than wider, but it doesn't rotate easily.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  2. I quit writing comments by Anonymous Coward · · Score: 3, Funny

    Because of shit like this. fuck you.

    1. Re:I quit writing comments by Anonymous Coward · · Score: 1, Insightful

      No, fuck you. Stop coding if you can't write simple fucking comments because you're butthurt over what one person said on the Internet, you stupid anonymous faggot cucklord.

    2. Re:I quit writing comments by Anonymous Coward · · Score: 5, Funny

      Linus? Is that you?

    3. Re:I quit writing comments by Areyoukiddingme · · Score: 1

      Linus is meaner than that.

  3. I don't use comments by Anonymous Coward · · Score: 5, Funny

    I like to make people work harder to figure out what I did.

    1. Re:I don't use comments by OrangeTide · · Score: 1

      I figured people are just going to rewrite everything the first chance they get. Learning some other guy's code base hasn't been fashionable for a few decades now.

      --
      “Common sense is not so common.” — Voltaire
    2. Re:I don't use comments by Anonymous Coward · · Score: 2, Interesting

      In the real world, "learning some other guy's code base" sometimes would indeed take more time than rewriting it the first chance you get.

    3. Re:I don't use comments by suutar · · Score: 2

      especially if it lacks comments

    4. Re:I don't use comments by bloodhawk · · Score: 1

      Back in the real world people don't try rewriting extremely complex things like kernels everytime they want to do a fix or add some functionality.

    5. Re:I don't use comments by pellik · · Score: 1

      (Score:-1, Not a comment)

    6. Re:I don't use comments by swillden · · Score: 5, Insightful

      I like to make people work harder to figure out what I did.

      I used to get a chuckle out of doing that... but then I figured out that the guy working hard to understand my code later is almost always me. I strive to write clean, clear code with useful comments to avoid making myself work harder to figure out what I did. Sometimes it even works.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    7. Re:I don't use comments by luis_a_espinal · · Score: 1

      especially if it lacks comments

      My experience in real life is that there is a high degree of correlation between a high number of dumbfuckery bugs in code and a lack of useful comments (*). They correlate like motherfuckers.

      * There is such a thing as a bad/useless comment. Think /* i is a counter */. Or worse, /* This function returns teh string./*. Or even worse, // This is a helper function.

      Yes, I've seen this.

    8. Re:I don't use comments by Khashishi · · Score: 1

      But without comments you miss out on the joy of writing comments that describe something slightly different than the code does.

  4. Arguing over the subjective by OrangeTide · · Score: 1

    And if you didn't agree, would you have changed your stance or argued that he's a crackpot?

    --
    “Common sense is not so common.” — Voltaire
    1. Re:Arguing over the subjective by tripleevenfall · · Score: 5, Insightful

      I'd remind him from the real world that he should be glad there are comments at all.

    2. Re:Arguing over the subjective by alvinrod · · Score: 4, Insightful

      Not the OP, but I don't particularly care about it in this instance (though I've got my own pet peeves in plenty of other cases), but when you work for a company or contribute to a project, you should follow their style conventions.

    3. Re:Arguing over the subjective by sunderland56 · · Score: 4, Interesting

      I both heartily agree with him, and think he's a crackpot. If you're trying to attract unpaid people to work on a project, this isn't the way to do it.

      // and, for the record, who uses c-style comments any more?
      // haven't written one in years
      // double-slash comments are the one and only improvement that c++ gave us

    4. Re:Arguing over the subjective by Jamu · · Score: 3, Insightful

      My preference is

      /*
              this type of comment
      */

      // or this

      --
      Who ordered that?
    5. Re: Arguing over the subjective by Kjella · · Score: 5, Insightful

      Linus got an abundance of coders and by far most are paid, you can't compare it to other projects where you're lucky to get volunters at all. The kernel runs everything from cell phones to supercomputers and the markets it doesn't dominate is not the kernel's fault. He can well afford to only take high quality code that follows the style guides. Linux is simply not like most projects.

      --
      Live today, because you never know what tomorrow brings
    6. Re:Arguing over the subjective by TemporalBeing · · Score: 4, Insightful

      I'd remind him from the real world that he should be glad there are comments at all.

      Since for anything to get merged it must pass by Linus, he can insist that you put comments on it or it does not get merged.

      The Kernel source actually has quite a few comments, and some very funny jokes running throughout it.

      So when dealing with a BDL or core maintainers for a project, you just do what they say as if they were your employer paying you - as any professional would do; or you go do something else.

      --
      Truth is like the sun. You can shut it out for a time, but it ain't goin' away. - Elvis Presley (source: imdb.com)
    7. Re:Arguing over the subjective by pellik · · Score: 1

      Hurd luddites? I thought this was about the linux kernel.

    8. Re: Arguing over the subjective by sunderland56 · · Score: 1

      Linus got an abundance of coders and by far most are paid

      If this was a paid employee, then this is basically a boss-to-employee performance review. Would you be comfortable with *your* boss giving *you* scathing bad performance reviews, live on the internet?

    9. Re:Arguing over the subjective by lgw · · Score: 4, Funny

      There is no problem that one can solve with object oriented design that cannot also be solved with structs and function pointers.

      There is no problem that can be solved with structs and function pointers than cannot also be solved with raw assembly code, written directly to disk using a sector editor (or butterflies). But it's fucking stupid to choose such a non-productive way to code if you're doing it for a living (I recommend everyone does it once for fun, though).

      The *only* advantage to object oriented design is more intuitive code organization, and that only within certain problem spaces.

      Even if you never use inheritance or polymorphism (which certainly only makes sense for certain sorts of problems), putting your functions into the same namespace as the data they operate on is always going to make for cleaner code.

      That right there is a significant win for C++.

      For almost all kinds of problems, the fact that C++ destruction can automatically release resources, so you can safely return from anywhere in a function instead of having goto fail all over the place is a significant win for C++. Too many programmers are just hopeless at getting the "clean up everything before you exit the function" right 100% of the time.

      For code organization, sometimes C++ "concepts" (static polymorphism, so no function pointers) are a nice win. Questionable whether the many lines of code you can save justifies the fact that you're writing template code, however.

      The more you look, the more places you'll find clean little wins for C++, with no performance cost.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    10. Re:Arguing over the subjective by arth1 · · Score: 1

      Agreed.
      Putting a * at the start of a line means you can't reflow the comment after making changes to it, without the asterisks suddenly becoming part of the text. Use /* before and */ after, and no asterisks at the start of the line. Sorry, Linus, you got this one wrong.

    11. Re:Arguing over the subjective by hcs_$reboot · · Score: 1

      Exactly. The syntax has two kinds of comments and that's for a reason.

      --
      Slashdot, fix the reply notifications... You won't get away with it...
    12. Re:Arguing over the subjective by cfalcon · · Score: 1

      C++ doesn't address the "goto fail" issue at all.

      If you have a list of things, each of which needs to be undone, and if a failure at any stage means you need to unwind the things prior to that, then "goto fail" is correct.

    13. Re:Arguing over the subjective by Ann+O'Nymous-Coward · · Score: 4, Informative

      I am so sick of that tired old pile of steaming crap. Just don't. It stopped being funny decades ago.

      Real programmers know that other programmers will have to support their code.

      Obey Wheaton's Law: Don't Be A Dick.

    14. Re: Arguing over the subjective by Anonymous Coward · · Score: 1

      That's scathing? You don't get out much do you? I think it was about as nice as it could be. He has to be firm and make his point clear. Being 'nice' does not work when it comes this sort of thing. You call it crap and leave it at that. I would be willing to bet cash this is not the first argument on the issue. He is usually pretty nice about it the first and second time. After that he just lays it out.

      He is not their 'boss'. He is the one who allows them the contribute to his source tree. He gets a bit of say.

    15. Re:Arguing over the subjective by Assmasher · · Score: 2

      The easiest distinguishing characteristic between a programmer and a software engineer - empathy for the people who have to test, maintain, document, and extend your code :).

      I've always been surprised that people don't consider them separate things (programmers and software engineers) - so maybe it's just me.

      --
      Loading...
    16. Re:Arguing over the subjective by sl149q · · Score: 2

      Hate to start an editor war, but vim has no trouble dealing with leading delimiters either.

      Get a real editor. Through out that IDE.

    17. Re:Arguing over the subjective by msauve · · Score: 5, Funny

      Emacs ... Use a real editor kid...

      "When I log into my Xenix system with my 110 baud teletype, both vi *and* Emacs are just too damn slow. They print useless messages like, 'C-h for help' and '"foo" File is read only'. So I use the editor that doesn't waste my VALUABLE time...Computer Scientists love ed, not just because it comes first alphabetically, but because it's the standard. Everyone else loves ed because it's ED!... When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!"

      -Ed is the standard text editor.

      --
      "National Security is the chief cause of national insecurity." - Celine's First Law
    18. Re: Arguing over the subjective by Midnight+Thunder · · Score: 1

      Real programmers know they might have to support their own code, that was developed 6 months earlier. Who knows what brainwave occurred and what was then quickly forgotten?

      --
      Jumpstart the tartan drive.
    19. Re:Arguing over the subjective by Jeremiah+Cornelius · · Score: 2, Interesting


      THIS is an ANUS:
      *

      THIS is an ANUS on SLASHDOT:
      *
      /.

      --
      "Flyin' in just a sweet place,
      Never been known to fail..."
    20. Re:Arguing over the subjective by rtb61 · · Score: 1

      Linus has achieved Godhood status, Grump Old Dude, don't worry, we all go there, well, at least those of us who survive long enough. That's why the good die young, as you get old you get a bit crusty around the edges, just a fact of life ;D.

      --
      Chaos - everything, everywhere, everywhen
    21. Re: Arguing over the subjective by swillden · · Score: 1

      Linus doesn't pay them and isn't their boss. Their boss tells them it's their job to get the changes they want upstreamed into the kernel. Linus' job is to act as gatekeeper, to keep the code quality high... which includes demanding good, consistently-formatted comments.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    22. Re:Arguing over the subjective by Tough+Love · · Score: 1

      // double-slash comments are the one and only improvement that c++ gave us

      "Us" being the herd of luddites who did not learn object oriented programming in school and are too special to bother learning it now.

      Wow, luddites are out in force with mod points.

      --
      When all you have is a hammer, every problem starts to look like a thumb.
    23. Re:Arguing over the subjective by colinrichardday · · Score: 1

      Maxwell's Equations don't cover quantum computing.

    24. Re:Arguing over the subjective by mark-t · · Score: 1

      Agreed. Which is why it is best to write code whose functionality is self evident from the names of the functions it calls and identifiers it uses. If the code is clear, comments are superfluous, and largely unnecessary.

    25. Re:Arguing over the subjective by lgw · · Score: 3, Insightful

      C++ lets you have classes that clean themselves up. The useful pattern is to do this for primitives, not complicated objects. E.g

      FileHandle file = fopen(...)

      You use file just like you would a FILE*, except you don't need to explicitly call fclose(). No clean-up block at the bottom, you just return, and fclose(file) is called as part of exiting scope. You can call fclose() if you want to for some reason, and that's safe too. It's as idiot-proof as code is going to get.

      That means you can return from any point in the code, and each such object you created will be unwound safely in the reverse order.

      It's really a huge win, and the pattern is easily adaptable to anything with reserve-release bookends.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    26. Re:Arguing over the subjective by Dutch+Gun · · Score: 4, Informative

      C++ absolutely solves the "goto fail" issue. The term that describes this is RAII. C++ uses objects and smart pointers (which are just pointers wrapped in objects) to hold resources. When objects go out of scope, those resources are automatically destroyed. There's very little need to clean anything up manually with modern C++.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    27. Re:Arguing over the subjective by catmistake · · Score: 1

      With that kind of attitude, you'll never pass any software engineering practical exam, and thus never become legally licensed to practice software engineering in the civil, academic, corporate or industrial world. On the other hand, programmers never needed such things, will need no stinking license to practice ever, won't need tuition debt, and certainly don't need a stinking framed degree with a fake and insulting euphamism for "programmer" printed in fake caligraphy. Real software engineers are actually spoiled rich and bored programmers trying to prove something. Programmers simply program, otherwise they are not programmers, but hacks (not to be confused with 'hackers').

    28. Re:Arguing over the subjective by Killall+-9+Bash · · Score: 1

      // not everyone
      // comments the
      // same way
      /*
      * this is how i'm told to comment Java
      * UNCLEAN
      */

      --
      "Prediction: within 10 years, Windows will be a Linux distribution." Me, 7-6-2016
    29. Re: Arguing over the subjective by swillden · · Score: 2

      "Code quality high". Are you fracking kidding me! This is the Linux kernel we are talking about. The code is hacker crap!

      It's better to stay silent and have people think you a fool than to open your mouth and remove all doubt.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    30. Re:Arguing over the subjective by arth1 · · Score: 1

      Emacs can fill (reflow) comments with leading delimiters no problem. [ Use a real editor kid. :-)

      Yes, but does it know the difference between a leading delimiter and that character being there for a different purpose?

      /* Initialize to test vslue
      * foo = 42;
      */

      If your editor is broken and removes the * thinking it's a delimiter, you're the one with a problem, not the one making the comment. /* and */ were chosen in C because it was unlikely they would occur naturally. The pascal (* and Fortran * in column 1 were rejected precisely because they can occur naturally in a free-flow language like C.

    31. Re:Arguing over the subjective by Megane · · Score: 2

      // double-slash comments are the one and only improvement that c++ gave us

      Why won't people accept the existence of C99 over 15 years later? (Microsoft has to be the worst offender about this, they refuse to support it in VS.)

      If you want to talk about Luddites, the anti-C99 Luddites are worse than the anti-C++ ones.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    32. Re:Arguing over the subjective by Hylandr · · Score: 1

      Just because it's hard to write doesn't mean you had more skill. It's usually the opposite. It's at least professional to let the maintainers know what the hell was going through the devs mind.

      --
      ~ People that think they are better than anyone else for any reason are the cause of all the strife in the world.
    33. Re:Arguing over the subjective by smallfries · · Score: 2

      Get a real editor. Through out that IDE.

      Can't decide if this a typo, bait fir the grammar nazis, or a clever reference to evil mode. Well played.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    34. Re:Arguing over the subjective by Hylandr · · Score: 2

      Mature Voice of Experience speaking here:

      There's a difference, there really is.

      I'm in college

      And don't say this in public if you want to be taken seriously. Though in the context you wrote it in tells me it will only help until you open your mouth.

      --
      ~ People that think they are better than anyone else for any reason are the cause of all the strife in the world.
    35. Re: Arguing over the subjective by Anonymous Coward · · Score: 1

      We have someone like you in our team, so let me break you the bad news. You are a PITA. He does it because at the keyboard he's he's a two finger pecker, and a word saved is a minute gained.

      What's your excuse?

    36. Re:Arguing over the subjective by Guy+Harris · · Score: 1

      THIS is an ANUS: *

      That's not the word Vonnegut used.

    37. Re:Arguing over the subjective by donaldm · · Score: 1

      Putting a * at the start of a line means you can't reflow the comment after making changes to it, without the asterisks suddenly becoming part of the text.

      Emacs can fill (reflow) comments with leading delimiters no problem. [ Use a real editor kid. :-) ]

      I just had a 1980's Déjà vu flashback. :-)

      Next, we will be talking about the wonders of "Edlin" -- err let's not.

      --
      There ain't no such thing as proprietary standards only proprietary formats. Standards are by definition open.
    38. Re:Arguing over the subjective by aethelrick · · Score: 1

      Comments are only superfluous in this situation if they are paraphrasing your code. Comments should document the code's intent not it's actions. Assume the reader knows little about the problem domain and document WHY your code is doing something not WHAT it is doing and then they'll always be useful to those who come after you (or yourself in 12 months)

    39. Re:Arguing over the subjective by devent · · Score: 1

      For almost all kinds of problems, the fact that C++ destruction can automatically release resources, so you can safely return from anywhere in a function instead of having goto fail all over the place is a significant win for C++.

      Too bad that that's not true. Dtors cannot throw exceptions, that means that dtors are only useful for releasing memory resources.
      Dtors are useless for releasing anything else, because all other resources can throw an exception upon release.
      For example, for the classical file stream example Dtors are useless.


          ofstream myfile;
          myfile.open ("example.txt");
          myfile

      You see that the ofstream have a method close() and is not using the Dtors of C++. That's because see my point above.

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    40. Re:Arguing over the subjective by devent · · Score: 1

      RAII is only useful for pointers. Dtors cannot throw any exceptions, that means that RAII is useless for anything else. See my post above. A GC is a more elegant solution for memory management.

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    41. Re:Arguing over the subjective by devent · · Score: 1

      The Slashdot forum here is broken.
      ofstream myfile;
          myfile.open ("example.txt");
          myfile -- "Writing this to a file.\n";
          myfile.close();
          return 0;

      http://www.cplusplus.com/doc/t...

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    42. Re:Arguing over the subjective by silentcoder · · Score: 2

      Real programmers write code with cat and make changes with sed.

      If you have to use awk, you lose points.

      --
      Unicode killed the ASCII-art *
    43. Re:Arguing over the subjective by cmiller173 · · Score: 4, Funny

      I don't know about empathy but I try to live by -- "code/comment as if your code will be maintained by a psychopath who knows where you live."

    44. Re:Arguing over the subjective by Rob+Riggs · · Score: 1

      GC is unusable for real-time systems. Heck, dynamic allocation can be unusable for some systems. RAII provides deterministic behavior and timing. And if is useful for far more than memory allocation. Suggesting otherwise just demonstrates ignorance. Not throwing in destructors is rarely a limitation. GC has its place, but IMO it is overused in modern systems.

      No one memory allocation is better than another. They all have their place and it is a well-rounded professional that knows this.

      --
      the growth in cynicism and rebellion has not been without cause
    45. Re: Arguing over the subjective by nine-times · · Score: 1

      Well they're paid, but they aren't necessarily paid by Torvalds. I forget who are the big contributors. Redhat and IBM? Anyway, it's still a public project, and so he's making public statements about his style guide. I think if he were slightly less dickish about it, it would be fine.

    46. Re:Arguing over the subjective by AmiMoJo · · Score: 1

      "Goto fail" isn't an issue.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    47. Re: Arguing over the subjective by mark-t · · Score: 1

      I didn't say I don't write comments, I said comments should be theoretically unnecessary. They are an admission of failure on the part of the programmer that they have not made their code clear enough to be self-explanatory.

    48. Re:Arguing over the subjective by Assmasher · · Score: 1

      I like yours better. Conveys more with less, is clever and yet strikingly clear and understandable by everyone.

      --
      Loading...
    49. Re:Arguing over the subjective by luis_a_espinal · · Score: 2
      I'm going to lose the mod points I gave, but whatever...

      RAII is only useful for pointers. Dtors cannot throw any exceptions, that means that RAII is useless for anything else. See my post above.

      Dafuq? Are you serious?

      A GC is a more elegant solution for memory management.

      There are entire classes of problems for which a GC is not acceptable, not just in the embedded realm, but in the application/system/large memory realms. There are reasons why the Java VM provides for direct byte buffers or why .NET allows you to jump from managed code to un-managed code.

    50. Re:Arguing over the subjective by mark-t · · Score: 1

      Consider the following code snippet:

      // Check to see if the employee is eligible for full benefits
      if ((employee.flags & HOURLY_FLAG) && employee.age>65)
      ...

      vs

      if (isEmployeeEligibleForBenefits(&empoyee))...

      The comment in the former case is arguably neccessary to explain why the condition is there, but why becomes self-evident in the second case... because the function is already named something clear, a comment should not even be be necessary at the function definition, the prototype for which would look something like: bool isEmployeeEligibleForBenefits(employee_t *);

      Comments are useful for explaning intent behind design decisions, for example:

      int compareTwoElements(elem_t *lhs, elem_t *rhs)
      {
      if (is_string(lhs) && !is_string(rhs)) {
      return -1; // strings are less than everything else
      }
      ...
      }

      (Okay.... I tried using   to indent that cleanly.... not sure why they aren't showing up)

      Anyways.... my point is not that comments are never necessary, but more often than not they are used to clarify code that has not been written as clearly as it could have otherwise been. In my experience, comments still have their uses, but in practice, they are actually fairly few and far between.

    51. Re:Arguing over the subjective by sydneyfong · · Score: 1

      Perhaps you'll also learn not to take comments on Slashdot seriously.

      Seriously though, it's hard to believe *anything* taught in schools at all would be helpful (without proper interpretation). Different problems require different solutions and different processes, and not every solution / process fits the problem. So far, all the crap floating around claims it's the best thing since sliced bread, but they don't really tell you the context in which their solution works (and they probably don't have sufficient perspective to tell you anyway). Your professor in school is probably clueless as to their differences anyways, anyone who is intimately involved in real-world software projects don't have time to teach.

      That being said, before you dismiss the stuff in your textbook and lecture notes, be aware that a lot of the software processes are for *long term*, *medium-to-large scale* projects. Your weekend project doesn't have to follow those processes, and probably shouldn't. There is a difference between code monkeys writing "code" and somebody who understands the "software engineering stuff" as well. I wouldn't attempt to make serious distinctions between "programmers" and "software engineers" and what not. They're merely stupid labels. Most people fall between the extremes -- although these days, with everything becoming a software/data problem, people from non-software disciplines occasionally have to write programs, especially in the scientific/engineering fields. They might be able to cobble together something that works, but I wouldn't trust them to run a 10-man software project.

      --
      Don't quote me on this.
    52. Re:Arguing over the subjective by aethelrick · · Score: 1

      I see, understand (and even agree with parts of) the argument you're making in your original post above... "If the code is clear, comments are superfluous"; The trouble is that code is often not clear to the reader, and it's really hard for the writer to make a judgement call on the reader's behalf, as to what constitutes "clear". Therefore, I would always advise commenting the intent of code in case you get it wrong, and some poor guy with a different definition of "clear" has to fix it in the future. This way, he can read your commented intentions, compare them what the code actually does and have a chance of applying a working fix.

      Your conveniently simple example in the previous post would likely not require a comment, however, the code INSIDE of your isEmployeeEligibleForBenefits() method would likely need clear comments to explain why it works in the particular way it does.

    53. Re:Arguing over the subjective by lgw · · Score: 1

      Primitives don't throw exceptions. That's the whole point. (Streams are useless, not destructors.) fclose() doesn't have the concept of exceptions, nor do any of the C system libraries in any platform I've seen.

      Destructors for any non-trivial class should be empty (unless you have some debug logging etc). For a non-trivial class, the members will clean themselves up if needed, even if you throw from the constructor. No destructor needed.

      Don't put cleanup logic in some elaborate File class - like you say, that's useless. Put it in the file handle class, which is only a wrapper for FILE* or HANDLE or whatever on the platform.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    54. Re:Arguing over the subjective by DCFusor · · Score: 2

      It's also moderately trivial to re-format comments in source using many available tools if one desires to do so. Some already-rolled ones, almost any language that supports regex, even, gawd, bash scripts with sed and awk etc can do this. If you don't like it that much, make a tool that fixes it. It ain't rocket surgery, it's a job for an otherwise boring afternoon. I don't recall any compiler whatever having an issue figuring out which of the input was comments. Go to town, how hard can it be?

      --
      Why guess when you can know? Measure!
    55. Re:Arguing over the subjective by luis_a_espinal · · Score: 1

      There is no problem that one can solve with object oriented design that cannot also be solved with structs and function pointers.

      There are some problems that can be solved with structs and function pointers which cannot be solved with object oriented design (without duplicate code).

      Concrete, non-trivial examples please.

    56. Re: Arguing over the subjective by mark-t · · Score: 1

      The funny thing is, however, those cases do not happen that often in practice

    57. Re:Arguing over the subjective by HeckRuler · · Score: 1

      The *only* advantage to object oriented design is more intuitive code organization,

      Code modules are .c and .h files in a folder. As packaged and organized as C++ classes. The namespace collision issue never seemed that big to me. If they collide, your naming scheme sucks. For the love of god don't name anything as generic as Init(). Names are important, in any language.

      There is no problem that one can solve with object oriented design that cannot also be solved with structs and function pointers.

      Yeah, that's called a Turing Tarpit. It's definitely possible, but you probably shouldn't do it.

      C is pretty terrible at making GUIs. The GTK can do it, but MAAAAAAN is it more of a chore than the C++ GUI makers. Which is so far the only place I've really seen OO shine. I've heard the mantra that it can be useful all over the place, but so far all I've seen is clusterfuck after clusterfuck.

    58. Re:Arguing over the subjective by almitydave · · Score: 3, Informative

      If you need to use < or > in your slashdot comments, you need to type &lt; and &gt; since slashdot interprets the < or > as marking HTML tags. If you have Notepad++, use TextFX Convert -> Encode HTML to automatically convert code samples, e.g.:

      #include <iostream>
      #include <fstream>
      using namespace std;

      int main () {
          ofstream myfile;
          myfile.open ("example.txt");
          myfile << "Writing this to a file.\n";
          myfile.close();
          return 0;
      }

      --
      my, your, his/her/its, our, your, their
      I'm, you're, he's/she's/it's, we're, you're, they're
    59. Re:Arguing over the subjective by bozzy · · Score: 1

      Good rule. Since at least the in short term, that psychopath will be you....

    60. Re:Arguing over the subjective by mysticgoat · · Score: 1

      Parent post makes a couple of good points. One of those could use a little sharpening:

      The critical difference is not between "programmer" and "software engineer". There are persons with good and bad practices in both camps.

      The critical difference is between "code monkey" and "strategic developer". A lot of self-labeled "programmers" are code monkeys who may sometimes be quite clever, but have not acquired the wisdom to do the elegant thing. A lot of newly credentialed "software engineers" are also mere code monkeys. Code monkeys have their place, and they can be quite productive, especially when they are put into closely managed environments where strategic developers set strict rules about comments, naming conventions, and styles. (cue "What Would Linus Do?")

      Strategic developers see beyond the limited vision of code monkeys. They are concerned with much more than developing a solution to the immediate coding problem; their vision and scope of action involves long term maintenance; ease of repurposing code to some other project; fitting the product into the target ecosystem of software, and so on. Software engineering curricula are intended to prepare students for this role, but of course they generally fail to do so: I doubt that there are any persons with brand new diplomas who can be entrusted with anything beyond a code monkey's role.

      That said, the general purpose of any college course is not to teach particular skill sets (like proper use of regexes, bash scripts, etc) but to encourage students to learn how to learn these skills. The good student will teach himself the necessary skills when he needs them. Instructors do not have to know the specific skill sets to present environments that challenge the student to learn how to learn. The details of how POSIX and PCRE regexes differ are not an appropriate subject; the reasons why Perl has its distinctive shape and feel, and the reasons why POSIX was brought into being should be touched on.

      It can be argued that persons with software engineering credentials are more likely to become good strategic developers. But that is not always the case, and it is also true that code monkeys with no formal training have often become good strategic developers.

    61. Re: Arguing over the subjective by Bongo · · Score: 1

      I'm only an amateur but I write comments to myself to explain not what it does but the intention behind it. For example, we picked 80% as a moderate amount of space to leave free before performance starts to suffer, but it could be anything from 70% to 90%.

    62. Re: Arguing over the subjective by mysticgoat · · Score: 2

      No, that's wrong.

      Good comments say in natural language what the code is intended to do, and what non-obvious reasons make it the way it is. The code in the programming language should be as readable as possible, but that does not negate the value of the comment. Both are needed for efficient bug hunting and validation.

    63. Re:Arguing over the subjective by robkeeney · · Score: 1

      You obviously have no working knowledge of C++. RAII is the answer which you are obviously ignorant of. "goto fail" is full of fail.

    64. Re:Arguing over the subjective by robkeeney · · Score: 1

      What are you talking about? That tutorial you linked to is crappy. The correct code there is

      int main()
      {
              ofstream myfile( "example.txt" );
              myfile << "Writing this to a file.\n";
              return 0;
      }

      The ofstream constructor opens the file for writing and the destructor takes care of flushing and closing the file.

    65. Re:Arguing over the subjective by mysticgoat · · Score: 1

      The *only* advantage to object oriented design is more intuitive code organization

      And that is one f*ckin' HUGE advantage.

      The biggest obstacle to writing good code efficiently is the coder's mind. The biggest costs associated with production and maintenance of software are wetware costs, not software, and not hardware. OOP makes more efficient use of our wetware than structured programming.

      While it is true that OOP is only appropriate in a smallish subset of the programming universe, that smallish subset encompasses more than 95% all of the business and commercial applications that ever were, are now, and ever will be.

    66. Re:Arguing over the subjective by OrangeTide · · Score: 1

      Yup, it's usually Linus's way or the highway.

      --
      “Common sense is not so common.” — Voltaire
    67. Re:Arguing over the subjective by segin · · Score: 1

      you just do what they say as if they were your employer paying you

      Considering that most of the kernel development these days (93% of commits, averaged annually, I believe, or a conservative estimate of 80% from the Linux Foundation) is done at the instruction of the employer that is paying the developers, and that company is aware of the rules for getting code upstreamed, then, by proxy, Linux and co. ARE their employer, in a way, since said employee is being paid to write code and do so to the specifications that Linux and co. lay out.

    68. Re:Arguing over the subjective by segin · · Score: 1
    69. Re:Arguing over the subjective by Cederic · · Score: 1

      Hmm. Jargon file and XKCD would disagree with you.

    70. Re:Arguing over the subjective by gzuckier · · Score: 2

      And if you didn't agree, would you have changed your stance or argued that he's a crackpot?

      last time I changed my stance, a Republican Senator smiled at me over the toilet stall partition.

      --
      Star Trek transporters are just 3d printers.
    71. Re:Arguing over the subjective by gzuckier · · Score: 2

      My code has tons of comments. I use them to deactivate big chunks of code I don't want to run right now.

      --
      Star Trek transporters are just 3d printers.
    72. Re: Arguing over the subjective by gzuckier · · Score: 1

      No, that's wrong.

      Good comments say in natural language what the code is intended to do, and what non-obvious reasons make it the way it is. The code in the programming language should be as readable as possible, but that does not negate the value of the comment. Both are needed for efficient bug hunting and validation.

      who here hasn't seen commenting of the form:
      /*adding a to b*/
      c=a+b;
      it's often more useful to tell you what you're not doing and why. /*you can't just use c from the database because it's often incorrect, so calculate it from scratch*/

      --
      Star Trek transporters are just 3d printers.
    73. Re:Arguing over the subjective by silentcoder · · Score: 1

      Like either ESR or Randal Munroe are real programmers :P

      --
      Unicode killed the ASCII-art *
    74. Re:Arguing over the subjective by Jeremiah+Cornelius · · Score: 1

      Thank you fir understanding that I was explicitly referencing "Breakfast of Champions".

      --
      "Flyin' in just a sweet place,
      Never been known to fail..."
    75. Re: Arguing over the subjective by mark-t · · Score: 1

      . /*you can't just use c from the database because it's often incorrect, so calculate it from scratch*/

      Indeed, and this is an example of what I would call a good comment. But what a code fragment does, and why, should ideally be so self-evidently clear from the function names that it calls and the names of the entities that it uses or manipulates that additional comments ought to hardly ever otherwise be required. Variable names and other identifiers can easily be long enough in modern languages to be descriptive about what the corresponding entity is and often why it exists at all that code which uses good naming practices from the ground up will rarely need any actual comments to explain them. With decent variable and identifier completion found in modern development environments, long variable names do not even have to be the source of typographical errors.

      I mentioned this example in another comment, but I'm particularly fond of it because it illustrates an important aspect of how comments are used.

      Consider the following conditional statement:

      if ((employee.flags & HOURLY_FLAG) && (employee.age > 65)) ...

      Now by itself, this isn't very clear, so it might need a comment above it:

      // Check to see if the employee is eligible for full benefits
      if (!(employee.flags & HOURLY_FLAG) && (employee.age > 65)) ...

      Okay, so now it is more obvious what the conditional is there for, but this can be refactored to eliminate the comment completely:

      if (employee.isEligibleForBenefits()) ...

      So now the conditional is clear without a comment.

      So what about the logic of isEligibleForBenefits? Wouldn't that still need some comments? Well, first of all, in the implementation of the 'isEligibleForBenefits', you don't need a redundant comment explaining that it tells you whether the employee is eligible for benefits because the function name itself already tells you that. Secondly, one could refactor its logic as follows:

      bool Employee::isEligibleForBenefits() const
      {
      return !this->isPaidHourly() && this->isLegalSenior();
      }

      Where isPaidHourly and isLegalSenior are both bool functions that simply return results like what was given in the two conditions above. Since the name of each function describes what is appropriate condition is for, and they are individually very simple one-line functions whose purpose is obvious from the name and behavior is so immediately self-evident from the simplicity of the code that there is no need to add any further comments.

      And by adding 'inline' to each these function definitions, you aren't even incurring the runtime penalty of a function call... any respectable optimizing compiler will make it efficient, and the resulting code is just as readable, arguably moreso, and without a single comment in the bunch.

      One might be compelled to ask if it would not be easier to just add a one-line comment to the original than to bother with all of that refactoring.

      To that I would say undoubtably... but the remaining problem with comments is that they can lie. Code can easily evolve from its original implementation, and where the changes at each iteration are individually so tiny that one does not necessarily remember they need to also update the comment... especially if different stages of the modification are being done separately by many people over a course of many months. Since compilers rarely check comments for semantic validity, you may be left with the documentation of your code found in the comment reflecting something other than what the code actually does, potentially costing the developer who must maintain it far more

    76. Re:Arguing over the subjective by GLMDesigns · · Score: 1

      Is there a middle ground between changing behavior and considering him to be a crackpot?

      Best is to come up with an agreed upon style. It's like driving on the right-side or left-side of the road. There is no objective "better" but it helps if we all drive in the same way.

      Re comments: pick a standard and go with it. It makes things easier to scan and legibility counts.

      --
      If you're scared of your govt then you need to further restrict its powers
      Vote 3rd Party in 2016 and beyond
    77. Re:Arguing over the subjective by phorm · · Score: 1

      You can also see a graph of the curse-word count here (also includes "Penguin")

    78. Re: Arguing over the subjective by MichaelJackson123 · · Score: 1

      Linus doesn't pay them and isn't their boss. Their boss tells them it's their job to get the changes they want upstreamed into the kernel. Linus' job is to act as gatekeeper, to keep the code quality high...

      Well, you can't deny the fact that Linux has some problems. Even Linus Torvalds, Andrew Morton, Con Kolivas and other Linux kernel developers say so: https://en.wikipedia.org/wiki/...

    79. Re:Arguing over the subjective by devent · · Score: 1

      Yes, and that's the problem. Then flush() will throw an exception because (for example) the disk was full, your program will just exit and the user's data are gone. In reality, you should write something like

                      ofstream myfile( "example.txt" );
                      myfile -- "Writing this to a file.\n";
                      ofstream flush(); // catch exception, warn the user, maybe try a redo
                      ofstream close(); // catch exception, warn the user
                      return 0;

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    80. Re:Arguing over the subjective by devent · · Score: 1

      Dafuq? Are you serious?

      Yes. See my argument above. Dtors cannot throw any exceptions, hence they are only useful for memory resources, i.e. resources that can't throw exceptions. For all the other resources, i.e. 99% of them, dtors are useless and RAII a serious design flaw.

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
  5. Linus the man-child by Anonymous Coward · · Score: 1, Interesting

    What happened in his childhood to arrest his development? Any shrinks in the house?

    1. Re:Linus the man-child by Anonymous Coward · · Score: 3, Insightful

      What happened in his childhood to arrest his development? Any shrinks in the house?

      It came in early adulthood when he confused good luck with genius. It happens all the time with the successful. They begin thinking they know more than their peers rather than they happened to be the lucky one at the right place at the right time.

    2. Re:Linus the man-child by paraax · · Score: 3, Insightful

      Not to back up the "all success is luck" meme but I would put it like this.
      There are any number of people who might have the skill to write a kernel.
      His "luck" was being the one who put in the work at the right time, caught the attention of other like-minded individuals to make it a community effort, and very effectively filled the niche that needed to be filled at the time. Without him it is fairly likely that another project would have eventually emerged, or that BSD would have been what people rallied around. And we'd then know another personality or group of personalities or company as the face of the open source operating system.
      That is not to say he doesn't have a crazy amount of skill.
      But that skill and that "luck" don't necessarily make his opinions infallible especially on something as asinine as this.

      That said, you don't like his management style don't work with him or with a company that requires you to work with him.

    3. Re:Linus the man-child by tnk1 · · Score: 1

      He did have an opportunity, which can be almost entirely luck.

      However, no one is really lauded for getting an opportunity, or we'd all admire Paris Hilton for being born rich.

      Linus was prepared to take advantage of the opportunity that arose. And that is something you *can* prepare for, if by simply working to be good at what you do, and putting in the work to make something.

      Linus did something. Admittedly, if Linus didn't, someone else would have, but they'd still have had to have done what Linus did in order to take advantage of the opportunity. We can admire the work and the commitment to the project while accepting that there are people out there who might have put in a similar amount of work, but never see any recognition.

      And that, friends, is why you should never set out to work on something merely to take advantage of some opportunity that you think might make you rich or famous, you should work on something because you enjoy it, or you think it fulfills a need for something that you think is lacking. Then you never really feel cheated by luck, because you weren't counting on luck to make the work worthwhile in the first place.

    4. Re:Linus the man-child by Archangel+Michael · · Score: 4, Interesting

      “Luck Is What Happens When Preparation Meets Opportunity" - Seneca

      If you're not prepared for opportunity, and someone else is, you call them "lucky". Probably because you were too busy with Pokemon Go!

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    5. Re:Linus the man-child by serviscope_minor · · Score: 1

      The opportunity presenting itself is, however, luck.

      There are people out there every bit as capable and productive as Linus, if not more, but the projects they happened to work on didn't have the same opportunity for scaling in the same way. Fabrice Bellard, for example.

      I've watched a lot of people go through academia. All the ones of interest for this discussion were very smart, very hard working, dedicated to their careers and so on and so forth. All of them had the preparation of which you speak. Only a few ended up with the opportunity in the end.

      This is not to discount those who succeeded of the people I know well every one was fully deserving of the success and did very well to get it. But to discount luck also does a disservice to those many people every bit as good who simply didn't have the luck.

      --
      SJW n. One who posts facts.
    6. Re:Linus the man-child by TheRaven64 · · Score: 1

      He didn't write most of the Linux kernel. He wrote a really crappy kernel, which had the advantage of being the only free option for a UNIX-like system on commodity hardware (MINIX was quite expensive and not permissively licensed yet, BSD was mired in the AT&T vs UCB lawsuit, which delayed the i386 port). Other people picked it up, fixed the worst bits, and ran with it. Linus has continued to work on it, but at this stage I don't think he's even the largest single contributor, let alone responsible for more than half of the code. He was very lucky to release a kind-of-working thing at the time when there were a bunch of talented people who would prefer to improve something than start from scratch.

      --
      I am TheRaven on Soylent News
    7. Re:Linus the man-child by Archangel+Michael · · Score: 1

      As a personal note, I've seen my share of "opportunities" in which I was not prepared. I've even seen some opportunities where I was prepared, but went to someone who wasn't prepared, because they had a better "personality" than I did, and those opportunities died.

      I dare say, that most people miss opportunities they are presented with, even if they are "prepared" for them because of some other reason (gumption, ethics, lack of ass kissing etc). I've seen "average" people, who work harder than "talented" ones, do better with less talent, simply because they work harder.

      There are a lot of circumstances to success, and putting everything together doesn't ensure success. People call that "luck". I call it .. not everyone can be a rock star. Is it fair? Life itself isn't fair. Call it luck. ;)

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    8. Re:Linus the man-child by ultranova · · Score: 1

      What happened in his childhood to arrest his development? Any shrinks in the house?

      Probably nothing. Lots of people are some degree of asshole and act out as soon as the society stops leaning on them to force them to behave. It's the motivation behind every rant against political correctness, for example, and you see how common those are.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    9. Re:Linus the man-child by luis_a_espinal · · Score: 1

      “Luck Is What Happens When Preparation Meets Opportunity" - Seneca

      If you're not prepared for opportunity, and someone else is, you call them "lucky". Probably because you were too busy with Pokemon Go!

      Bullshit regardless of which historical luminary said it.

      What happens when preparation never meets opportunity?

      Or what happens when the likes of Paris Hilton or Kim Kardashian are born in wealth.

      Luck is luck, a simple opportunity window that blesses equally the prepared as well as the one who (if you forgive the repetition) was born in luck.

      People who quote Seneca do so to dismiss that luck is a real, determining factor.

    10. Re:Linus the man-child by Archangel+Michael · · Score: 1

      If "Fame" is your only measure of success, then I guess "luck" has everything to do with it.

      Why didn't you mention Nikki Hilton? Because she isn't famous (media)

      And Kim Kardashian is famous for two things, sex video, and being the daughter of the attorney for OJ Simpson. Everything she's done since then is milked the opportunity she was given. And why didn't you mention Kloe? Because she isn't nearly as famous (media)

      Linus was in the right place, with the right tools, with the right attitude with the right licensing to make Linux work. Linux WOULD have been invented otherwise, and it might not have been as successful, but for Linus and his abrasive personality driving to make Linux better.

      I don't dismiss luck. Was Holly Holm Lucky when she knocked Rhonda out? OR was it hard work and opportunity ? Or are those the same thing?

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    11. Re:Linus the man-child by luis_a_espinal · · Score: 1

      If "Fame" is your only measure of success, then I guess "luck" has everything to do with it.

      No. It is not *my* only measure of success. It is one of the different measures that society and humanity measure success. Nice way to misread my comment though.

    12. Re:Linus the man-child by Archangel+Michael · · Score: 1

      I don't measure success by media attention. Lots of people are very successful without it. It is a horrible gauge. I didn't misread your comments, I read them fine. I completely read them, understood them, and explained why they weren't in my world view. When you give two examples, both "media darlings" whose claim to fame are SEX TAPES, then yeah, I can only draw one conclusion ;-)

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    13. Re:Linus the man-child by TheRaven64 · · Score: 1

      Even that's not really true. By the late '90s, most of the code had been written by other contributors and I wouldn't say that Linux became 'wildly popular' until then, or possibly even the early 2000s.

      --
      I am TheRaven on Soylent News
  6. I'm with Linus by wardk · · Score: 1

    those first two examples are hideous. I guess before I comment more I should read the article?

  7. Torvalds Must Die! by Bruce+Perens · · Score: 4, Funny

    Linus has been known as an acerbic and rude individual, but he's never dared to touch the sacred unbalanced comment before. He's gotten bolder as we've taken his stuff. We really should have held the line, called an end to it before now. This is what we get for pandering to him.

    It's too late to simply eject him from kernel development. We can't have him hectoring us from the sidelines. I'm afraid that we must entirely erase Linus Torvalds from the noÃsphere.

    Think of it as evolution in action!

    rot13: whfg xvqqvat

    1. Re:Torvalds Must Die! by thesupraman · · Score: 1

      rot13: V frr jung lbh qvq gurer, jbbfu.

    2. Re:Torvalds Must Die! by AmiMoJo · · Score: 1

      I feel like everyone is over-reacting. It's not like someone suggested using spaces instead of tabs.

      On matters of style I'm inclined to follow Linus. He predicted the dominance of widescreen monitors years before they became popular, with his insistence that tabs be 8 characters wide.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    3. Re: Torvalds Must Die! by Bruce+Perens · · Score: 3, Funny

      Dare you to support the wretched Torvalds, infidel! You shall reap the consequences. Those who are not for us are against us! Witness my horde of angry hackers. That is, for the moment that you can...

    4. Re:Torvalds Must Die! by LWATCDR · · Score: 1

      Frankly I would love to see Linus have to actually deal with the real world sometime. If the biggest problem you have are unbalanced comments then you are living a charmed life.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    5. Re:Torvalds Must Die! by Bruce+Perens · · Score: 2

      It's noösphere, except that Slashdot doesn't understand unicode. Jeez, what century do they think we're in. Anyway, it looks funnier the way it came out, sort of like "no ass sphere", which by definition would be a place free from Linus Torvalds :-)

    6. Re:Torvalds Must Die! by sanosuke001 · · Score: 1

      tabs are 3 characters wide and insert 3 spaces instead of 1 tab character. even on my 4k monitor. he can go to hell if he ever asks for 8 character tabs

      --
      -SaNo
    7. Re:Torvalds Must Die! by Areyoukiddingme · · Score: 1

      What's the noÃsphere?

      It was the noösphere before Slashdot got a hold of it. A word some pretentious asshole thought up to refer to the universe of ideas. Maybe when there are humans living on some other sphere besides Earth it will be a useful distinction. You could talk about the Earth noösphere and the Mars noösphere. Until then, it's just a molestation of two perfectly innocent Greek words. Or in Bruce's case, ferocious sarcasm.

    8. Re:Torvalds Must Die! by Areyoukiddingme · · Score: 2

      hectoring from the sidelines?

      What? It's a verb. Hey, when you're using weapons-grade sarcasm and words like noösphere, a little word like hectoring has to fend for itself.

    9. Re:Torvalds Must Die! by Megane · · Score: 1

      He predicted the dominance of widescreen monitors years before they became popular, with his insistence that tabs be 8 characters wide.

      But lines are still limited to 80 characters?

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    10. Re:Torvalds Must Die! by raynet · · Score: 1

      No no no, tabs should always insert a tab character, that way every single person reading the source can set the indent to something they prefer. For me that happens to be 2 spaces or 4, depending on language.

      --
      - Raynet --> .
    11. Re:Torvalds Must Die! by MichaelSmith · · Score: 1

      This is the problem: Torvalds has never had an actual, paying job with a boss to answer to.

    12. Re:Torvalds Must Die! by mlw4428 · · Score: 1

      I will not sacrifice my comment style. He complains and we relent. He demands standards and we conform. He assimulates thousands of developers and we kowtow .The line must be drawn here, this far no further. And I will make him PAY for what he's done! I WILL BRING ABOUT BASIC COMMENT SYNTAX REM.

    13. Re:Torvalds Must Die! by LWATCDR · · Score: 1

      So he is like Donald Trump.

      --
      See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    14. Re:Torvalds Must Die! by MichaelSmith · · Score: 2

      Ah no I didn't mean to imply that Linus is a steaming pile of dogshit masquerading as a wannabe politician.

  8. So, the kernel is done? by Anonymous Coward · · Score: 1

    No bugs left other than comment style disagreements? Rejoice, the year of Linux on the desktop can't be far!
    For what it's worth, my single contribution to the Linux kernel fucked up some white space. Torvalds didn't notice or I guess I would have woken up in the burn ward.

    1. Re:So, the kernel is done? by quantaman · · Score: 3, Insightful

      No bugs left other than comment style disagreements? Rejoice, the year of Linux on the desktop can't be far!
      For what it's worth, my single contribution to the Linux kernel fucked up some white space. Torvalds didn't notice or I guess I would have woken up in the burn ward.

      Hard-to-read comments make hard-to-read code. On a large project with multiple developers that matters.

      --
      I stole this Sig
    2. Re:So, the kernel is done? by Anonymous Coward · · Score: 1

      "Hard-to-read comments make hard-to-read code"

      This isn't about hard to read comments, it's about comment format that someone doesn't like. I can read the "crap" comments as easily as I can read the good ones, I'm not brain-dead. It's more about a visual style preference.

      And we wonder why people don't like the open source community? They resort to petty insults and swearing to make points, and I am supposed to devote my free time to supporting the projects? Give me a break. If I wanted to be subjected to name calling I would go back to High School or jump into an FPS.

    3. Re:So, the kernel is done? by DidgetMaster · · Score: 1

      That's nothing. I once had to debug some code written by someone who recycled variable names. Variable x meant something at the start of the loop but was assigned to mean something completely different later on. He was treating the variable name like a register where it contains whatever value you last put into it. Needless to say, the code was very hard to follow.

    4. Re:So, the kernel is done? by quantaman · · Score: 2

      "Hard-to-read comments make hard-to-read code"

      This isn't about hard to read comments, it's about comment format that someone doesn't like. I can read the "crap" comments as easily as I can read the good ones, I'm not brain-dead. It's more about a visual style preference.

      And I've worked on large proprietary projects, and finding code with random inconsistent styles is ugly and a massive PITA, and it does take up time when you're trying to figure out unfamiliar code and you're spending extra brainpower picking out comments.

      It's not even that one commenting style is fundamentally more readable (but I think Linus's suggestions are slightly more readable, and on a big project that matters). But having a consistent style throughout the project is very important.

      And we wonder why people don't like the open source community? They resort to petty insults and swearing to make points, and I am supposed to devote my free time to supporting the projects? Give me a break. If I wanted to be subjected to name calling I would go back to High School or jump into an FPS.

      Agreed, Linus's "management" style could certainly use a loss less swearing and insults.

      --
      I stole this Sig
    5. Re:So, the kernel is done? by Oligonicella · · Score: 1

      "or jump into an FPS" - LOL Truer words...

    6. Re:So, the kernel is done? by dbIII · · Score: 1

      That used to happen a lot.
      Add in undeclared variables typed by filename (if it starts with K it is an integer) for extra fun.

  9. Whom The Gods Destroy... by RobotRunAmok · · Score: 1

    ...they first cause comment syntax to twist their panties into a bunch.

    1. Re:Whom The Gods Destroy... by perpenso · · Score: 1

      ...they first cause comment syntax to twist their panties into a bunch.

      Huh, I thought it was tabs vs spaces first, comment formatting second.

    2. Re:Whom The Gods Destroy... by Tough+Love · · Score: 1

      ...they first cause comment syntax to twist their panties into a bunch.

      Huh, I thought it was tabs vs spaces first, comment formatting second.

      80 character lines.

      --
      When all you have is a hammer, every problem starts to look like a thumb.
    3. Re:Whom The Gods Destroy... by perpenso · · Score: 3, Interesting

      ...they first cause comment syntax to twist their panties into a bunch.

      Huh, I thought it was tabs vs spaces first, comment formatting second.

      80 character lines.

      I thought we all agreed to set our terminal windows to 120 characters?

    4. Re:Whom The Gods Destroy... by Anonymous Coward · · Score: 2, Funny

      I code and write on Windows, would it kill you penguin lovers to include a CR with your LFs?

    5. Re:Whom The Gods Destroy... by Megane · · Score: 1

      I code and write on OS X, would it kill you penguin lovers to respect case-insensitive filesystems?

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    6. Re:Whom The Gods Destroy... by powerlord · · Score: 1

      They're just jealous that OSX^H^H^HmacOS has finally brought *NIX to average the averagehome user's desk^H^H^H^Hlaptop.

      --
      This space for rent. All reasonable inquiries will be entertained at proprietors discretion.
    7. Re:Whom The Gods Destroy... by luis_a_espinal · · Score: 2

      ...they first cause comment syntax to twist their panties into a bunch.

      Huh, I thought it was tabs vs spaces first, comment formatting second.

      80 character lines.

      I thought we all agreed to set our terminal windows to 120 characters?

      The only people who do that are the ones who do not run side-to-side diffs. Have mercy on the people who have to run diffs while fixing your bugs and stick to 80 character lines.

  10. please just go all the way to the C++ mode by vux984 · · Score: 5, Insightful

    Seeing as 'C++ mode' // comments were added to the C99 spec; this would be my preference. I've always hated all forms of /* */

    1. Re:please just go all the way to the C++ mode by etinin · · Score: 2

      Is this even allowed in kernel code? I'm curious.

      --
      "I decided I could write something better than everything out there in two weeks. And I was right." - Linus Torvalds
    2. Re:please just go all the way to the C++ mode by TeknoHog · · Score: 1

      /* I wonder why the plainest possible comment format is not mentioned. After all, you only need the start and end markers because C does not care about line breaks. If you're going to pretend that line breaks have any significance in comments, with those cute asterisks in the beginnings of lines, then you might as well use the linebreak-sensitive C++ comment style. */

      # Or *gasp* switch to a language where line breaks matter in the actual
      # code too, so you can avoid typing and reading all that line noise.

      --
      Escher was the first MC and Giger invented the HR department.
    3. Re:please just go all the way to the C++ mode by Anonymous Coward · · Score: 3, Informative

      I use // for comments, and /* for disabling block of code.

    4. Re:please just go all the way to the C++ mode by bloodhawk · · Score: 1

      must say for a change I actually whole hearted agree with Torvalds, the style of commenting he is complaining about is a horrible method, much prefer the C++ mode myself.

    5. Re:please just go all the way to the C++ mode by mattventura · · Score: 1

      Am I the only one who wishes languages had different semantics for disabling code versus actual comments? Sometimes it's nice to have, plus it helps avoid the issue of having a block of code with a /* */ comment in it, then putting another /* */ around that block of code to disable it, only to find out that the first */ closed the outer comment.

    6. Re:please just go all the way to the C++ mode by tlhIngan · · Score: 5, Informative

      Am I the only one who wishes languages had different semantics for disabling code versus actual comments? Sometimes it's nice to have, plus it helps avoid the issue of having a block of code with a /* */ comment in it, then putting another /* */ around that block of code to disable it, only to find out that the first */ closed the outer comment.

      C does this quite well.

      Use

      //

      and

      /* */

      for textual comments.

      Use

      #if 0
      ....
      #endif

      for code comments.

      Bonus is many editors recognize the #If 0 idiom and automatically block-comment the code out!

      And the preprocessor is self-balancing, so every #if must have a corresponding #endif making it ideal for commenting out blocks of code.

    7. Re:please just go all the way to the C++ mode by etinin · · Score: 1

      Might've been sarcasm as well... Linus's messages are (sometimes deservedly) full of it.

      --
      "I decided I could write something better than everything out there in two weeks. And I was right." - Linus Torvalds
    8. Re:please just go all the way to the C++ mode by Oligonicella · · Score: 1

      It's not about the machine, it's about the human. They may not have much significance in a one sentence comment but they certainly have significance in a long (what should be) multi-paragraph one.

    9. Re:please just go all the way to the C++ mode by Bruce+Perens · · Score: 1

      Walter is a smart guy, I remember using his Zortech C++ on a PC project when I was at Pixar. It might have gotten farther if he'd been working at the right place when he started it. Symantec was definitely the wrong place.

    10. Re:please just go all the way to the C++ mode by Trogre · · Score: 1

      What's wrong with /*
        * A comment
        * block
        */
      for blocks and // for single or partial lines:
      int selection // Which menu option has been selected

      --
      "Nine times out of ten, starting a fire is not the best way to solve the problem." - my wife
    11. Re:please just go all the way to the C++ mode by swillden · · Score: 2

      Use

      #if 0
      ....
      #endif

      for code comments.

      Nah, don't comment out or ifdef out code. Just delete it. If you need to bring it back later, that's what version control is for.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    12. Re:please just go all the way to the C++ mode by kackle · · Score: 1

      I know what you're saying. I have coded in C for over a decade, but only "discovered" the following in the last few years after I was forced to use an editor that didn't have the features that you describe (as my last editors did). A space is all that's required:

      /* This code block does things. */
      blah;

      /* This block no longer does things. * / ...NOTE THE SPACE.
      blah2;
      blah3; // This does blah3.

      /* Back to more working code. */
      blah4;

      It's more helpful if the IDE colors the comments differently than the code.

    13. Re:please just go all the way to the C++ mode by wertigon · · Score: 1

      Because most sane editors do not wrap lines, instead preferring to let the user scroll to the right in order to read the entire line.

      Take, for instance, SDL...

      *window = SDL_CreateWindow("My pretty game", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1024, 768, SDL_WINDOW_SHOWN);

      In my editor that line gets truncated at around "1024".

      --
      systemd is not an init system. It's a GNU replacement.
  11. Re:The ORIGINAL picture used by TheReg was this by Bruce+Perens · · Score: 2

    I guess he doesn't like to be seen picking his nose :-)

  12. Parkinson's law of triviality by OpenSourced · · Score: 5, Funny

    At last a Linux development post where everybody can have an opinion! Gone are the obscure race conditions and unstable semaphores, where prudent programmers preferred to watch in silence and seem ignorant, rather than open their mouths and dispel all doubts.

    --
    Rome taught me patience and assiduous application to detail. Virtues which temper the boldness of great, general views.
    1. Re:Parkinson's law of triviality by OrangeTide · · Score: 1

      We're democratizing Linux! Tear down the ivory tower, and build up the code formatting style shanty towns in its place.

      --
      “Common sense is not so common.” — Voltaire
    2. Re:Parkinson's law of triviality by spotlight2k3 · · Score: 1

      /* *you have no opinion, It was removed on previous line */

  13. That's not punctuation by Anonymous Coward · · Score: 1

    That's formatting.

    1. Re:That's not punctuation by Megane · · Score: 1

      Exactly. I was expecting a rant about people not putting periods at the end of complete sentences in comments.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
  14. Re:Who Cares? by Yvan256 · · Score: 4, Funny

    Yeah! It's not like the guy fucking invented Linux or something!

  15. indentation too? by wierd_w · · Score: 1

    Does he have a passionate hatred for spacebar indents too?

    it isnt always ideal to tab indent.

    really, bitching over comment style? i cant wait to see the commit logs--"correct unapproved comment style, no changes in function."

    what a brave new world...

    1. Re:indentation too? by Austerity+Empowers · · Score: 3, Informative

      At least in all my professional software development, this kind of nitpicking is par for the course. The difference is that in a corporation you can strong-arm your team, either because they report to you or because you have political clout. In free software with something that has thousands or more of contributors, all you have is screaming loudly and offensively enough to get on slashdot. Then maybe people figure out that this is how they want it done.

      Someone could scream back with valid arguments about why: /* This is a good idea,
        * we should do this! */

      I can't think of one. All I can think of is "who cares", the answer to which is "Linus" (and others), and if I don't care I should just do it their way.

    2. Re:indentation too? by GuB-42 · · Score: 1

      I switched to this too.
      The difficulty is that if you mess things up or copy-paste some code written in a different style you have to do the reindentation by hand. "convert to spaces/tabs" usually isn't smart enough to do the job. And with a mix of tabs and spaces, it is easy to mess things up.

    3. Re:indentation too? by Actually,+I+do+RTFA · · Score: 1

      The first few weeks a programmer works for me, I expect a couple of commits like that. Their code should, stylistically, look like everyone else's. It helps maintain readability.

      --
      Your ad here. Ask me how!
  16. Blatant misrepresentation once again. by Anonymous Coward · · Score: 1

    Go ahead, point out where in here

    labelling some members “brain-damaged”

    is.

    "your commenting style/code/idea/product/argument/... is stupid" != "you are stupid".
    If you can't tell the difference, seek professional help.

    1. Re:Blatant misrepresentation once again. by apparently · · Score: 1

      It's literally in the first fucking sentence, you stupid fucking idiot.

    2. Re:Blatant misrepresentation once again. by Fwipp · · Score: 1

      Hi Linus! I didn't know you read slashdot.

    3. Re:Blatant misrepresentation once again. by chmod+a+x+mojo · · Score: 1

      Uh, no.

      Can we please get rid of the brain-damaged stupid networking comment
      syntax style, PLEASE?

      Pretty damn easy to understand that the syntax is "stupid and brain-damaged" is being said, and not that the writers are stupid or brain-damaged.

      So, who again is the "stupid fucking idiot"?

      --
      To err is human; effective mayhem requires the root password!
    4. Re:Blatant misrepresentation once again. by apparently · · Score: 1

      Ah yes, he's telling people that they're doing something stupid and brain-damaged, but somehow that means he doesn't think they're being stupid and brain-damaged.
      You truly are a genius.

  17. Fuck quality; we need balanced comments. by geekmux · · Score: 1

    As we step back and look at the overall quality of code these days, set to unleash that shitstorm on the IoT hell that will ultimately control the world around us...

    ...it sure is good to know that our "Linux Lord" has his /* fucking priorities */ straight worrying about comments.

    1. Re:Fuck quality; we need balanced comments. by fustakrakich · · Score: 1

      we need balanced comments.

      They must also be fair.

      Given his reaction to these kind of things, we should have some fun with it. Throw in a few extra typos, some smileys, words in different languages, whatever gets him to write about it..

      --
      “He’s not deformed, he’s just drunk!”
  18. Linus is right by jgotts · · Score: 5, Insightful

    Linus is right. I've been using the Linux kernel coding style as much as possible in all of my programming, regardless of the language, since around 1994. I get nothing but compliments.

    When it comes to the kernel, the most important thing is writing code that other people can read and modify. Anybody can write new code. It takes an artist to write code that other people can easily understand.

  19. Style cop.... (new an better) by Bomarc · · Score: 2

    First: I've had to use style cop. It sucks.
    But ... we each have our own variation of 'style'; which can be seen here.
    So, why not have a 'stylecop' that acts locally; on white space & comments? If I like 3 spaces, and you like 4; we can just get along. The style is formatted on view, not on compile.
    This would also fix his problem: When he views it... it will 're-format' to something he likes to see.

  20. So fix them. by Anonymous Coward · · Score: 1

    How hard would it be to simply write a script to reformat all comments in the preferred style? Not that hard I imagine...

    This comment will not be saved until you click the Submit button below.
    You must wait a little bit (2 minutes) before using this resource; please try again later.

  21. Re:Who Cares? by OrangeTide · · Score: 1

    Maybe anyone who wants to get their kernel patches upstream?

    --
    “Common sense is not so common.” — Voltaire
  22. From the nothing-really-wrong dept. by Howitzer86 · · Score: 1

    The fact that this is what he decides to rant about is... probably a good thing.

  23. Just reformat it to your liking. by innocent_white_lamb · · Score: 1

    My preferred coding style happens to be Whitesmiths. (Go ahead and laugh, but I'm used to it.)

    Since not much new stuff outside of my own is written in Whitesmith's style, I use astyle to reformat the the other guy's code if I'm going to be studying it or adding to it or whatever. I actually have astyle fully integrated into both Geany and vim (the two code editors that I use) so I can reformat code instantly on demand.

    I've never paid much attention to comment styles as such, but I'm sure that you can use astyle to reformat that if you want to; it has a million-and-one options available to put out all sorts of cats and make coffee.

    So if Linus or anyone else doesn't like a C style, it takes almost no effort to reformat it to the style that you want. Then everyone gets to look at and use what he's comfortable with, and there's no friction at all.

    --
    If you're a zombie and you know it, bite your friend!
    1. Re:Just reformat it to your liking. by Waffle+Iron · · Score: 1

      Reformatting code is a big no-no in shared version-controlled environments.

      In many version-controlled environments, a hook is added to the check-in command to automatically run the reformatter, so there are never any diffs in the history caused by the formatting process.

      I really don't like some of the settings that were made on the formatter my current project is using, but at least I never have to worry about things like typing lines too long. They're automatically fixed up on commit.

    2. Re:Just reformat it to your liking. by bmk67 · · Score: 1

      Since not much new stuff outside of my own is written in Whitesmith's style

      There's a reason for that, you know.

    3. Re:Just reformat it to your liking. by LesFerg · · Score: 1

      Whitesmiths?

      Has anybody ever held you by the throat and said between slaps "stop" thwack "indenting" thwack "like" thwack "that!"?

      Just curious.

      --
      If I had a DeLorean... I would probably only drive it from time to time.
    4. Re:Just reformat it to your liking. by gzuckier · · Score: 1

      Do what I do; on the last day of your job, open every program code you have access to and reflow all the code into paragraphs. You will not be soon forgotten.

      --
      Star Trek transporters are just 3d printers.
  24. I agree with Linus. by Mysticalfruit · · Score: 2

    Poorly created comments are the work of the devil, plan and simple. Imagine working on a piece of software after it's been in active development for 10 years.
    Some libraries just work and nobody's even looked at the code for 1/2 a decade. Shitty comments will kill you, or worse others...

    Linus can be a needlessly pretentious ass about things, but I agree with him on this one.

    --
    Yes Francis, the world has gone crazy.
    1. Re:I agree with Linus. by Virtucon · · Score: 1

      Speaking as somebody who's written code dating back to the 70s, be thankful I even comment the code. In some circles the code should be self evident and comments are like so much belly button lint; interesting but it doesn't serve a purpose.

      --
      Harrison's Postulate - "For every action there is an equal and opposite criticism"
    2. Re:I agree with Linus. by murdocj · · Score: 1

      That seems to be the modern style: "my code is so clear and self-evident it doesn't need comments". Except it isn't. I couldn't count the number of hours I've spent decrypting what some chunk of code does, or worse, figuring out why something that looks obviously extraneous or even wrong is actually necessary. My attitude is that if you don't have time to write the comment, you shouldn't bother writing the code. And if you have trouble writing the comment, the code is probably wrong.

    3. Re:I agree with Linus. by Virtucon · · Score: 1

      i tend to have mixed reactions on both sides of it. If it's a method of say 25 lines and it's not too obscure why put comments in there? Then again if somebody wants do to some lambda expressions with multiple streams going in parallel, then yeah comments at least leave some breadcrumbs. I just to believe in shooting the messenger if there are comments there, regardless of style. There's utilities that can clean up comments so it the developer doesn't need to fuss much about style, line spacing etc.

      --
      Harrison's Postulate - "For every action there is an equal and opposite criticism"
  25. Surprise, surprise by CheapEngineer · · Score: 2

    The Donald Trump of software developers.

  26. Torvie's got it all wrong by Tablizer · · Score: 3, Funny

    They are not comments, they are Perl.

  27. Go hard, or go home! by ben_kelley · · Score: 1

    We're talking formatting here.

  28. Doxygen Style by friedmud · · Score: 2

    /**
      * If you adhere to Doxygen style comments
      * it clears this up nicely.
    */

    1. Re:Doxygen Style by friedmud · · Score: 1

      lol - missed a space before the closing comment ;-)

      The asterisks should be aligned ;-)

    2. Re:Doxygen Style by Areyoukiddingme · · Score: 1

      You mean

      //! Fuck.
      //! That.

    3. Re:Doxygen Style by Barlo_Mung_42 · · Score: 1

      \_()_/

  29. It's got to be said. by MouseTheLuckyDog · · Score: 2, Insightful

    I wish he would worry more about systemd and less about comments.

    1. Re:It's got to be said. by phantomfive · · Score: 4, Informative

      He has influence over comments. He doesn't have influence over systemd.

      --
      "First they came for the slanderers and i said nothing."
    2. Re:It's got to be said. by thegarbz · · Score: 1

      It's not that he doesn't worry over systemd, it's that he doesn't feel the need to. He doesn't mind the project and doesn't get what all the hate is about, and even criticised the person who asked him about it as they asked about it in a roundabout way.

    3. Re:It's got to be said. by phantomfive · · Score: 1

      FFS it's shit like this which makes outsiders look at the Linux community and wonder why we can't just get over things and focus on actual issues, like making desktops that rival Windows and focus on the actual issues with Linux rather than these trivial matters.

      Code quality is the actual issue....otherwise we might as well give up and just use Windows. We want a clean, good system.

      --
      "First they came for the slanderers and i said nothing."
  30. Re:extra stars are stupid by GuB-42 · · Score: 1

    It is probably to help distinguishing comments from non-comments, especially when syntax highlighting isn't used, or in patch files.
    Some text editors manage this style of comment quite well.

  31. // Badly formatted comments on Slashdot by owlstead · · Score: 1

    /*
    * Guys, I already see a lot of badly formatted comments here.
    * I thoroughly agree with Linus here, comments should be correctly formatted.
    * Unbalanced comments should be removed and boxed comments are right out.
    */

    1. Re:// Badly formatted comments on Slashdot by herbierobinson · · Score: 1

      The first * doesn't line up with the rest of them... :-)

      --
      An engineer who ran for Congress. http://herbrobinson.us
    2. Re:// Badly formatted comments on Slashdot by owlstead · · Score: 1

      Yeah, that kinda took the fun out of it. I blame the /. editing tools. It *was* perfectly aligned.

  32. Re:Really Linus?!? by suutar · · Score: 2

    It's probably not even the biggest thing on his "Kernel Shit Must Change" list; more of a "this came up, so here's my opinion; now I'm gonna do something else". At least, that's how I interpret his email.

    But why would you expect to see stuff about war, famine, or the Kardashians on the linux kernel mailing list?

  33. Re:Really Linus?!? by avandesande · · Score: 1

    Some things are like Chinese water torture... how many years has he been doing linux kernal?

    --
    love is just extroverted narcissism
  34. Things I Hate by avandesande · · Score: 2

    Lets start a 'things I hate' thread... I can't stand pluralizing database table names. Its redundant. Who is going to store one record in a table?

    --
    love is just extroverted narcissism
    1. Re:Things I Hate by billybob2001 · · Score: 1

      Who is going to store one record in a table?

      Oracle created a table called dual.
      One row, one column.
      It's a singular name (not "duals").
      It's called dual because it used to contain 2 rows.

    2. Re:Things I Hate by Actually,+I+do+RTFA · · Score: 1

      I prefer pluralized database table names. Because, when spoken, it;s shorter. That is, I can see saying, e.g. "Join pastas and sauces" or "Join the pasta table and the sauce table". It doesn't feel right to say "Join pasta and sauce"

      --
      Your ad here. Ask me how!
    3. Re: Things I Hate by Actually,+I+do+RTFA · · Score: 1

      As an English sentence, yes. As a statement about a JOIN operation on tables, no.

      --
      Your ad here. Ask me how!
    4. Re:Things I Hate by billybob2001 · · Score: 1

      From the History section on https://en.wikipedia.org/wiki/...

      Chuck Weiss explains why he created DUAL:

      I created the DUAL table as an underlying object in the Oracle Data Dictionary. It was never meant to be seen itself, but instead used inside a view that was expected to be queried. The idea was that you could do a JOIN to the DUAL table and create two rows in the result for every one row in your table. Then, by using GROUP BY, the resulting join could be summarized to show the amount of storage for the DATA extent and for the INDEX extent(s). The name, DUAL, apt for the process of creating a pair of rows from just one.[1]

      The original DUAL table had two rows in it (hence its name), but subsequently it only had one row.

  35. Many things are worse than bad comment punctuation by 140Mandak262Jamuna · · Score: 4, Interesting
    Worst comments are obsolete comments. The comment described what that function was designed to do, some 8 years ago. It has morphed since, default arguments added, the list has been replaced by multimap which was replaced by hashmap completely changing the behavior, and still the comments have not been updated.

    Next worst are ego comments. Every inline function preceded by three line comment naming the author as though he is Leo Tolstoy or she is Jane Austen.

    Next worst are trivial comments. Next worst are no comments.

    Then comes badly formatted comments.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  36. Gordon Ramsay in sweary rant about cooked steak by seoras · · Score: 1

    ... just doesn't have the same click bait appeal does it?
    I think it might be fun to put Linus in a kitchen with Gordon just to give him a taste of his own medicine and vice versa ;)

    Those who get to the top of their profession are driven perfectionists who expect everyone else around them to strive to achieve that same level of perfection.
    I get why they lose it with others less driven and focused.
    Do they need perspective or should we just leave them alone to continue to be brilliant? I think the latter.

  37. I'm more pissed off by... by istartedi · · Score: 1

    I'm more pissed off by the unnecessary leading *, since any editor worth a damn has syntax highlighting. It's his project though, so he can set whatever standard he wants and if you don't like that you can fork it. Once again, pretty much any style problem can be solved in the editor, and most editors already fix this problem; but that's just my opinion and it's worth less than his because I'm not leading a kernel project that runs bazillions of servers.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    1. Re:I'm more pissed off by... by istartedi · · Score: 1

      I don't think fixing style problems in the editor would be a crutch. I think it would end a lot of arguments, like tabs vs. space--at least for leading tabs/spaces. The only thing that's a bit complicated is __LINE__, but with enough AI in the editor it might be a fixable problem too--have an editor command that lets you jump to the repository __LINE__ even if it doesn't match __LINE__ in the editor. Also, the compiler has to use the repository __LINE__. I know I'm probably leaving something out. Yes, I've put some thought into it over the years; but not enough to crack open an open source IDE and hack it.

      --
      For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
    2. Re:I'm more pissed off by... by Oligonicella · · Score: 1

      It's perhaps worth less than his re comments in Linux that he is involved with. Your opinion is of equal worth otherwise. He's not a god, he's a guy.

  38. Re:40 column mode by Anonymous Coward · · Score: 2, Interesting

    many of us have worked on devices where EVERY byte of memory was a scarce resource. comments generally only live in source not binary but I had code where I even had to remove error handling to save a few bytes of memory in an EDI system.

  39. Well, that's just like, your opinion man. by GrBear · · Score: 1

    /* ââ©â®(ÎY_ÎY)ââ©â® */

    1. Re:Well, that's just like, your opinion man. by GrBear · · Score: 1

      Annnnd, once again /. fails the UTF-8 test.

  40. Linus vs Microsoft by jmhysong · · Score: 1

    I hated using Windows for years because I thought that Bill Gates and friends were assholes for their business practices. Now I hate Linux, not because Linus has evil business practices, just because he's as much an asshole as they ever were.

    1. Re:Linus vs Microsoft by serviscope_minor · · Score: 1

      I disagree. Linus is an asshole on an individual level because he has a big ego and no one to tell him he's being an idiot. Microsoft are assholes on a corporate scale for money. If you use Linux but never get involved in kernel development, you will never bump into Linus's assholery. Even if you avoid Microsoft "products" like the plague, you cannot avoid them because of their stacking of standards bodies to get pointless, trivial but patented stuff of theirs baked in, exFAT in SDXC for example. And if you are a customer, well fuck you you're having your machine upgraded forcing you to sign up for new, nasty spyridden T&C whether you fucking like it or not.

      --
      SJW n. One who posts facts.
  41. its sujbective but by JustNiz · · Score: 1

    I prefer // for single line comments /*
          for multiple line
          comments
    */

    1. Re:its sujbective but by sysrammer · · Score: 1

      I prefer // for single line comments /*

            for multiple line

            comments
      */

      Arrrgh!

      --
      His ignorance covered the whole earth like a blanket, and there was hardly a hole in it anywhere. - Mark Twain
  42. Can't believe I'm the first to say this but... by hardluck86 · · Score: 1

    /* No Comment */

  43. Most commercial projects have a code style by iamacat · · Score: 2

    If Linux aims for the same level of polish and stability, it's not a bad idea to do the same. Someone else will likely have to fix bugs in your code at some point. Having a consistent style of comments and other things makes it faster to scan visually and spot problems for someone used to that style.

  44. Three Space Indent! by crow · · Score: 1

    I love three-space indent!

    Not really, but that's actually what I use because work mandates it. Apparently there was a big debate in the early days of the company between 2 and 4, so they compromised. Much of our coding standard is based on one particular engineer who had vision problems and needed to keep the number of columns restricted.

    But you know what? It works. Millions of lines of code dating back two decades, and it's extremely consistent. Ninety percent of the code looks like it was written by the same engineer. That's what you want on a major project.

    Though I will say that I've come to hate tabs in indentation. They're fine until they're not. At some point you end up using some tool where they don't look right.

    My pet peeve, though, is trailing spaces. Any code management system should be designed to strip trailing spaces or block commits that contain them. I've seen far too many code merges break because of a disagreement on trailing spaces, and that's just dumb.

    1. Re:Three Space Indent! by murdocj · · Score: 1

      Turns out that as long as you use tabs *consistently* to indent code, they're fine. And it's also handy because for us older devs, we can set the indentation the way we need it. I've dealt with code that has a 2 space indentation and I find it virtually unreadable. But if you use tabs for the indentation, you have 2 spaces per tab, I can have 4, everybody's happy.

    2. Re:Three Space Indent! by crow · · Score: 1

      No, because you may find that you need to use half a dozen different tools that all display the code, plus emailed copy-and-paste snippets here and there. Sure, you can control what a tab expands to in your primary editor, but you don't have control over all the other tools.

      Yes, if the use of tabs is completely consistent, then at least the code won't be too terribly mangled by other tools, but it won't look anything like what you're used to.

    3. Re:Three Space Indent! by LesFerg · · Score: 1

      I also like to have my editors set to display the tab characters, in a very low contrast color, so there are visible lines for each level of indentation. There are several add-ins for Visual studio to draw colored margin lines for each level and/or type of indentation, but I find them overkill and prefer the visible tab chars.

      --
      If I had a DeLorean... I would probably only drive it from time to time.
  45. Re:Valley by murdocj · · Score: 1

    Man, don't go there.

  46. This reminds me of top-posting in newsgroups. by PJ6 · · Score: 2

    It's common email convention now, at least in my experience - when you respond to someone, you put your response on top, so as the conversation chain grows, the order is the most recent (and therefore the most pertinent) to the oldest, descending. So you don't have to scroll through pages just to see the last reply.

    Back in the day, on newsgroups, if you did that you'd get absolutely SCREAMED at for "TOP POSTING", because it was WRONG.

    From the guardians of all that is right and wrong.

    1. Re:This reminds me of top-posting in newsgroups. by Mars+Saxman · · Score: 1

      I still disprefer that style. It works ok for quick one-liner replies, I guess, but what I really want is a conversation, and that means I want the context quoted near the reply, inline.

      Alas, Microsoft never understood that there is more than one way to do it, and shoehorned their corporate style down our throats by making it difficult to convince Exchange to work any other way, so we're stuck with the dominance of top-posting now.

    2. Re:This reminds me of top-posting in newsgroups. by phantomfive · · Score: 1

      I think gmail set the precedent, by collapsing the quoted text, and setting the cursor at the top of the screen. At least, the disappearance of bottom-posting seems to coincide with the rise of gmail in my memory.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:This reminds me of top-posting in newsgroups. by DNS-and-BIND · · Score: 1

      Top-posting WAS wrong. Do you seriously not understand that different eras have different standards?

      The only reason top-posting is accepted today is because Microsoft Outlook defaulted to top-posting on replies, because someone at Microsoft had never heard of Usenet. So many of Microsoft's mistakes had been done before and MS just repeated them. Plus they added many of their own...auto-executing email attachments WTF. I remember when the idea you could get a virus by email was laughable.

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
    4. Re:This reminds me of top-posting in newsgroups. by angel'o'sphere · · Score: 1

      Top posting is still wrong, for two reasons.
      A) you would know if you where on mailing lists that offer "mail digests" where all mails for a certain time period are gathered and sent in one mail. With 'top quoting' a few dozen replies and replies to replies lead to an complete unreadable mess of repeated original questions, awnsers, comments cluttered all over the place in the digest. Not to mention that 12 mails would cover perhaps 12 screen heights but now do cover 100 or more.
      B) all modern email readers show you mails that belong together anway in a "modern threaded" way in single panels in one mail window. So instead of scrolling over the wrong quoted text, you just scroll to the next 'panel'

      (And old school mail programs/news readers anway know about 'threaded mode' hence the reason usenet users are upset about Top Quoting)

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    5. Re:This reminds me of top-posting in newsgroups. by MichaelSmith · · Score: 1

      I totally agree.

      Back in the day, on newsgroups, if you did that you'd get absolutely SCREAMED at for "TOP POSTING", because it was WRONG..

    6. Re:This reminds me of top-posting in newsgroups. by AmiMoJo · · Score: 1

      The problem is that in-line replies are horribly broken now. Every time I try it at work with Outlook it just fails completely. There is some weird "quote line" that doesn't break when you insert blank lines into the quoted text! Top posting is the only option when people send you broken HTML mail.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    7. Re:This reminds me of top-posting in newsgroups. by PJ6 · · Score: 1

      Yet, you fail to give any explanation at all as to why bottom-posting is better. I think I clearly explained why I preferred top-posting. This was long before MS had an email client.

      But your answer is just, "Because... Microsoft! BLARG!". You're exactly the kind of wignut I was talking about. You scream about why top-posting is wrong, but can never give any good reason why.

  47. /* comments */ by neoRUR · · Score: 1

    /*
    * some
    * people
    * don't know
    * how to speak
    * in public
    */

  48. Why curse? Just codify your style... by mi · · Score: 2

    Why wouldn't he simply codify his preferences? I hear, he still holds some sway among Linux developers — once a particular style is accepted by consensus, it becomes easier to convince folks to follow it...

    Interestingly, the style Mr. Torvalds prefers has been part of BSD's style(9) manual for decades.

    Maybe, he should leave children's to children and join a real OS-project...

    --
    In Soviet Washington the swamp drains you.
    1. Re:Why curse? Just codify your style... by guestapoo · · Score: 1

      Why wouldn't he simply codify his preferences?

      https://www.kernel.org/doc/Doc...

      Chapter 8: Commenting
      ....
      When commenting the kernel API functions, please use the kernel-doc format.
      See the files Documentation/kernel-doc-nano-HOWTO.txt and scripts/kernel-doc for details.

  49. Stallman hated // C++ comments by xx_chris · · Score: 1

    which is odd since it's pretty much the only thing C++ did right.

    1. Re:Stallman hated // C++ comments by serviscope_minor · · Score: 1

      Just like the Romans. What did C++ do for us? // comments.

      Apart from that?

      Better type safety?

      yes yes but apart from nicer comments and better type safety

      Automatic resource cleanup?

      yes yes but I mean APART from nicer comments and better type safety and automatic resource cleanup?

      A programmability in the compiler and a nicer, cleaner, safer alternative to macros?

      Yes but apart from all of those, what has C++ done for us?

      --
      SJW n. One who posts facts.
    2. Re:Stallman hated // C++ comments by ultranova · · Score: 1

      Better type safety?

      It's more efficient to use a "dynamic" language. That way obviously broken code compiles without warnings, so you can ship it and charge your customers for bugfixes.

      Sucks if you actually care about code quality, though.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  50. Crappy asterisks by ooloorie · · Score: 1

    How about leaving out the crappy asterisks at the beginning of lines? They suck.

  51. Re:Really Linus?!? by xx_chris · · Score: 1

    More years than he hasn't been doing the LInux kernel. He's 46 and he started 24 years go when he was 22. September 1991.

  52. Re:Style cop.... (new an better) by swillden · · Score: 1

    First: I've had to use style cop. It sucks. But ... we each have our own variation of 'style'; which can be seen here. So, why not have a 'stylecop' that acts locally; on white space & comments? If I like 3 spaces, and you like 4; we can just get along. The style is formatted on view, not on compile. This would also fix his problem: When he views it... it will 're-format' to something he likes to see.

    Check out clang-format. It's by far the best code formatting tool I've used, and using it allows you to stop thinking about formatting. However, your idea of everyone reformatting the code all the time to their preferred style is silly. Set a project style, "document" it in a .clang-format file and require everyone to use it. Everyone working on a project can learn the project's style; the tool just helps to make sure that it's applied consistently.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  53. Could be worse by viperidaenz · · Score: 1

    It could have been a tabs vs spaces rant

    We all know that didn't work out very well for Richard Hendricks

  54. Re:Many things are worse than bad comment punctuat by swillden · · Score: 1

    Next worst are no comments.

    I disagree.

    Uncommented code that needs comments is bad, but the best code doesn't need comments at all. If I write a piece of code that requires a comment to be understandable, that's a hint that I need to step back and rethink that code. Maybe name variables better. Maybe pull a chunk out into a separate function so I can name that (that's particularly useful with those one-line comments that explain the goal of a block of code). Maybe reorder or reorganize it so that it's clearer.

    Sometimes, after all I can do, I still feel like I need a comment so I write one, trying to keep it as concise, accurate and readable (including formatting) as possible. But I always consider that a failure and know that if I were a better programmer I could have avoided it.

    The reason it's a failure and that it's better to avoid writing comments if you can is because comments are much less well-maintained than the code they describe. That means that comments often become obsolete (what you called the "worst comments"). Comments that don't exist can't become obsolete.

    Note that I'm talking here about internal comments, not interface documentation, and especially not Javadoc/Doxygen/etc. comments which are used to generate API documentation. Those are very valuable and should always be written. Even those should be kept concise, though, and redundancy should be avoided. There's no reason to restate the function signature. If the function and argument names are well-chosen, they can often stand on their own. Let them.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  55. Re:Good thing Linus is already married by colinrichardday · · Score: 1

    Yes, he has 3 children

  56. Sayre's Law by Jeremi · · Score: 1

    "In any dispute the intensity of feeling is inversely proportional to the value of the issues at stake."

    --


    I don't care if it's 90,000 hectares. That lake was not my doing.
  57. sweary? by righteousness · · Score: 1

    I actually initially read it as "sweaty rant", and imagined Linus furiously typing the rant, with sweat dripping onto his keyboard. Probably because "sweary" is not a real word, and my mind sort of auto-corrected it to the closet match.

    --
    Don't fornicate. Seriously, just don't do it.
  58. So Linus, Tabs or Spaces? by mveloso · · Score: 1

    So what is it, tabs or spaces?

  59. We finally are by invictusvoyd · · Score: 1

    Humans ..er .. I meant Hackers .

  60. My only comment in code are at the top..... by sp4ni3l · · Score: 1

    /*
    * This is a comment
    * I hate comments
    */

    As it is only once I do it in a software project I will indulge any style that is requested.......

    Bring it on!

  61. I don't understand the fuss.... by clickety6 · · Score: 1

    Can't we all just use our comments sense?

    --
    ----------------------------------- My Other Sig Is Hilarious -----------------------------------
  62. Sweary? by Eunuchswear · · Score: 1

    He said "crap".

    That's "sweary"?

    Fuck.

    --
    Watch this Heartland Institute video
  63. Re:Many things are worse than bad comment punctuat by Ambassador+Kosh · · Score: 3, Insightful

    I don't agree with this viewpoint at all.

    I have been working on some scientific simulator code and the comments have the math equations that a block of code is based on. It makes it so much easier to understand since it is often not obvious how an equation is mapped into implementation (things like discretization make things far more complex).

    Comments should not say what code does it should be why. I don't need you to see that your code is adding up a bunch of numbers but knowing why it is doing it is very important.

    --
    Computer modeling for biotech drug manufacturing is HARD! :)
  64. Re:Many things are worse than bad comment punctuat by 140Mandak262Jamuna · · Score: 1
    I agree with Kosh, not with swillden.

    The most important comments are the ones that specify "why not". Often we will implement the interface using some methods, after release we find the inadequacies and change the implementation. Often the first implementation would be simple, intuitive and the first thing anyone would think of. Now that implementation is gone, and new less obvious and often tricky things are introduced. If the "why this and not that" comment is missing, a later code review might remove the complex second implementation and restore status quo ante.

    It is important to document why it is not done that way, what we intend to do. Without it we will be forced to constantly reverse engineer to understand the code and might repeatedly re learn the same lessons over and over again.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  65. Obligatory TECO reference by bromoseltzer · · Score: 1

    TECO will solve all your problems.

    --
    Fiat Lux.
    1. Re:Obligatory TECO reference by cwills · · Score: 1

      is it line noise, or is it TECO?

  66. Re:Many things are worse than bad comment punctuat by swillden · · Score: 1

    I have been working on some scientific simulator code and the comments have the math equations that a block of code is based on.

    That is absolutely a case where comments are essential. Ideally, they should not only contain the equations, but something of the derivation of the mathematical expressions and the rationale behind their use. In some cases it *may* be possible to write code in such a way that the expression itself is clearly expressed in the code, so a comment specifying the expression would add nothing... but even in that case an explanation of why that expression is appropriate is essential for any future understanding of the code. And in many cases the constraints of the programming language to not allow easy, direct statement of the expression, either, and then the comment that contains the mathematical representation is essential.

    I'm not claiming that it's always possible to eliminate comments, but they should be eliminated whenever it is possible, and whenever you find yourself needing a comment you *should* take a step back and see whether it's possible to make the code clear without one.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  67. Under enough pressure ... by Rambo+Tribble · · Score: 1

    ... even the greats can go OCD on you.

  68. it is a practical matter by charliepjive · · Score: 1

    I totally agree with him and I don't see why anyone would use the other comment style, which is very less practical

  69. Re:Many things are worse than bad comment punctuat by swillden · · Score: 1

    The most important comments are the ones that specify "why not".

    Like complex mathematical derivations, that's another case where comments may be essential. My recommendation isn't to eschew all comments, it's to avoid duplicating in comments what can be just as clearly expressed in code... and to work hard to try to express the information in code rather than in comments. Doing so will make your code cleaner and much more maintainable.

    My code isn't comment-free, but it is comment-light, and I think it has gotten much better since I adopted this policy (which, BTW, I should be clear that I didn't originate. I got the idea from one of Robert Martin's books on code craftsmanship.).

    Some examples might help. Consider this case, where I had to write a comment to explain why not to do something. Or (to pick a section from the same file), look at this case which is interesting because the comment is very large -- as large as the code that it documents -- and because I think that without the comment it's really not clear why the code is doing what it's doing. I have toyed with various ways of refactoring that code to eliminate the need for the comment, but short of using something like a strategy pattern I can't find one that does the job. And even a strategy-based implementation would still require me to both ensure that the strategies are applied in the correct *order*, and to document what that order is.

    Doh! I just noticed that that long comment has bit-rotted a little. It was originally written when the code only handled options 1, 3 and 6, so the concluding paragraph doesn't explain about options 2, 4 or 5, or why they're tested in the order they are. That example is an even better one than I thought, since it demonstrates both the need for and risks of explanatory comments.

    That SoftKeymasterContext class, however, is an exception to the rule. It exists specifically to address a bunch of unusual corner cases and so it's not surprising that it requires much more explanation than 99% of code should. Here's a better example (chosen more or less at random from the same project) of what comment-free code should look like.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  70. Back at the Uni by Dareth · · Score: 1

    I once got a few points knocked off my working code because of comments. I was told I didn't have enough General comments. My next program had nice blocks of comments about General Lee, General Custer, and many other famous generals. My instructor wasn't nearly as amused as I was. Imagine that.

    --

    I only look human.
    My mother is a halfling and my dad is an ogre, so that makes me an Ogreling
  71. For non-native speakers and literalists: by fyngyrz · · Score: 1

    Well, I am neither brain-damaged nor a native speaker, and it is pretty clear to me that, while he does call the unbalanced comment style "brain-damaged", nowhere did he call *anyone*, not even those who like that style, brain-damaged.

    That interpretation requires that comments have brains. They don't. So this particular remark can reasonably be read to impugn the author of the comments. However, it's also extremely likely that this is a case of hyperbole; in which case smiles are called for, not outrage.

    Yes, English is annoying. Linus can be, too. :)

    --
    I've fallen off your lawn, and I can't get up.
  72. You can write Object Oriented C code by h4ck7h3p14n37 · · Score: 1

    You do realize that you can write object oriented code in C with structs and function pointers, don't you?

    Take a look at Berkeley Sockets, as you go up the networking stack structs extend other structs, which is OO design.

  73. It is not unusual. by luis_a_espinal · · Score: 1

    In the real world, "learning some other guy's code base" sometimes would indeed take more time than rewriting it the first chance you get.

    If you haven't learned what something does and how it does it, then how the f*ck are you going to succeed at rewriting it?

    By re-implementing the functional requirement that is supposed to be met by the God-awful complicated (and most likely buggy) code from scratch. Typically you have to delve into existing code to integrate or to fix something. Most often to fix something. So in those cases:

    • You know what the code is supposed to do, functionally, and
      • either the code is not doing it right, or
      • it is doing it right, but it is additionally doing something wrong

    Think clean-room re-engineering from specs. This happens all the time, a system or function F that is supposed to do A, but that it uses too much memory, or it is too slow, or it leaks resources.

    Whatever, but you know what F is supposed to do.

    And the code behind A is just nasty and impenetrable, so hard to untangle to simply fix what is broken.

    So you implement it from scratch so that it does A without all the other unwanted shit. That's how it is done all too often in the real world.

  74. power by gzuckier · · Score: 1

    has gone to his head.
    /*
    good
    */

    ./*bad
    */

    is not the worst programming problem I see

    --
    Star Trek transporters are just 3d printers.
  75. Must be about perfect code now by ebvwfbw · · Score: 1

    If he's complaining about comments, Linux must be close to perfect. Otherwise, he'd be worried about that instead.

    Hell, I'm happy if my guys leave ANY comments in their code.

    In the past I have seen very unprofessional comments. One where they bitched back and forth, calling each other names.... and so on. Even the women could get very testy.

  76. Re:Many things are worse than bad comment punctuat by swillden · · Score: 1

    At best your code can explain what it's doing, but not why or how. I mean, it's great that I can see you frob and then swizzle. But why frob first and swizzle second? Why frob at all? Why not frobnicate instead?

    dom

    Sometimes those sorts of things do require explanations which can't be made clear through naming. Most of the time, though, good naming and good code structure can explain everything except the road-not-taken questions... and it's relatively rare that the road-not-taken choice is actually important enough, or has sufficient non-obvious rationale, that it requires explanation. If it does, by all means put it in a comment, though -- and note that that sort of comment *doesn't* tend to become obsolete.

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  77. OCD? ASD? by andrewwarrenau · · Score: 1

    Oh lordy, OCD+ASD to the max methinks. If this trivia is enough for him to work up a head of steam then all else must be full of rosy awesomeness in Linuxland.

  78. Award-winning example of comment style by Keybounce · · Score: 1

    The importance of good commenting can be seen in this winning example of C code

    https://github.com/c00kiemon5t...


    main(C,V)
    char **V; /* C program. (If you don't
      * understand it look it
      */ up.) (In the C Manual)
    {
            char _,__;
            while (read(0,&__,1) & write((_=(_=C_C_(__),C)),
            _C_,1)) _=C-V+subr(&V);
    }

    (GRR, how do you tell slashdot to NOT ALTER THE FORMATTING AT ALL!?!?)

    Yes, there's more (see link). But you can clearly see the importance of comments there.

  79. Coding style is a vehicle to convey your brillince by SpaghettiPattern · · Score: 1

    Coding style is a vehicle to convey your brilliance. You're a decent programmer so conform to whatever the style is on the project you work in. Don't waste your precious short life on arguing about style.

    For instance: In order to be able to comply to any coding style, I always set up my modules so that reordering members will not affect the functioning. Want to order constructors, getters/setters and/or other methods differently? Want to order static members in a very specific way? All fine by me.

    Let's get the real issue at hand be dealt with.

    --

    I hadn't the slightest objection to his spending his time planning massacres for the bourgeoisie... (P.G. Wodehouse)
  80. Re:Many things are worse than bad comment punctuat by 140Mandak262Jamuna · · Score: 1
    Thanks for the follow up. I agree with you on using long descriptive function names and variable names to reduce the need for comments.

    Differences in our backgrounds explain the different emphasis we are placing on comments. But all three of us agree more than we disagree. Splitting hairs about the last 5% disagreement, while ignoring 95% agreement.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  81. Re:Many things are worse than bad comment punctuat by swillden · · Score: 1

    But all three of us agree more than we disagree. Splitting hairs about the last 5% disagreement, while ignoring 95% agreement.

    We're programmers :-)

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  82. Pascal format FTW! by KlomDark · · Score: 1

    It's way better to use Pascal-style comments:

    {
        This is a comment
    }

    (I started with Turbo Pascal, and the first time I saw C code I was so confused - It's all comments, how does this work at all?) :)

  83. That's good news by allo · · Score: 1

    When Torvalds has the time to rant about comment formatting, then there can't be big problems in the code currently.

    btw: There are tools to fix formatting automatically.
    related: They don't use doxygen (like syntax)?

  84. Braindead by Vlijmen+Fileer · · Score: 1

    Braindead indeed.

    Mouth-foaming fool Torvalds is at it again, trying to talk down on some normal and inconsequential commenting habits.
    I would not be surprised if his preferences are in line with his coding preferences' in relation to braces, where he started a Holy Fulmination (t/m) against that guy with the beard.

    Arrogant airheaded asshole.