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
*/

7 of 523 comments (clear)

  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: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.

  3. 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.

  4. 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.

  5. 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.
  6. 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."
  7. 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