Torvalds Loses His Shit

...and he's right.
theregister.co.uk/2016/07/11/linus_torvalds_in_sweary_rant_about_punctuation_in_kernel_comments/

web.archive.org/web/20160713233450/http://www.theregister.co.uk/2016/07/11/linus_torvalds_in_sweary_rant_about_punctuation_in_kernel_comments/

Other urls found in this thread:

lkml.iu.edu/hypermail/linux/kernel/1607.1/00627.html
github.com/scrooloose/nerdcommenter
twitter.com/NSFWRedditVideo

He's right though. Sloppy comments like that belong in the trash.

Just give us a non-bullshit mailing list link instead of this tabloid clickbait trash, for fuck's sake

lkml.iu.edu/hypermail/linux/kernel/1607.1/00627.html
It was easy to find, does your keyboard not work or something?


I knew it was a matter of time before he said something about comments. He's right though. Despite normal symmetrical comments, people will always find a way to impose their own half-assed style in every project they touch.

Does the OP's brain not work?

Slow news day at theregister? 1) He's right 2) that's barely rant.

He is right, though. I think I would also eventually flip if I had been reviewing other people's shit for most of my life and they never seem to improve.

Proper coding style is a requirement for projects involving a lot of people coding, specially if the language used allow for stupid and/or confusing constructs (like C and all the languages that are inspired in its syntax). He's hardly the only one guy telling people that, either.

Jesus. Literally, the fiirst comment I ever wrote was formatted

/* LikeThis*/

Who the fuck would think that

*/ like*this*/
Is a good idea?

//)***********************************************************************************(//)***********************************************************************************(//)==\%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%/==(//)---\%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%/---(//) > $(CURRENT_YEAR) //) > having unfashionable comments//)---/%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%\---(//)==/%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%%%%}{%%%%%%%\==(//)***********************************************************************************(//)***********************************************************************************(

// Honestly I don't see what the fuss is about.// Is he going on about lines of comments with// the same amount of characters on them?// Both block comments look fine to me.

I'd say the same about
if(foo)
bar();
but Linus likes that one and I've had a patch rejected some years back for 'wasting space' writing it in a safe style. That was before the Apple vuln, though.

I will occasionally use that one if it's a one-off if

He's talking about the number of characters (spaces, slashes and asterix) before the words start on the line, making the text part of the comments misaligned.

He wants comments to be easily readable and look nice. With his preferred method, everything is clean, symmetrical, and professional. You have /* and */ on their own lines, alone, vertically aligned with each other, and each line of the comment is preceded with a * to make it clearly stand out as a commented line. Or, // before every line, still clearly denoting each individual line as a comment. With the various other methods, there is no order, no consistency, and poor or no symmetry. Code in the kernel is expected to conform to a particular style; the comments should conform to a particular style, too.

...

This is funny because this is how Apple's old source code looks.

I prefer boxed in comments. Very readable.

Also worth noting that this is how Torvalds always talks online and this is nothing special.

Yeah, I've had a few errors as a result of this. For that very reason I have cindent set to 4 spaces when there's no {}, instead of the full (8-space) tab.

Ugh, I hate that so much, I wish curly brackets were mandatory.

Non-mandatory brackets make more sense when you see brackets as a way of combining multiple lines of code. The brackets are normally used in combination with the if statement but they can function alone.

I understand what he's getting at, and he's not wrong, but (no) and (no-no-no) seem so innocuous that it makes me wonder why Emperor Linus would ever bother, well, commenting on it. Also he never commented on , maybe it's not kernel style either.
Now boxed-in comments.
Motherfucking boxed-in comments.
That shit boils my fucking blood.

Yeah, but then it's not really clear where the statement starts and ends. Whitespace isn't clear enough.

Read the mailing list post.
It's one of the only two multi-line comment styles acceptable for the kernel, the other being /** opening and closing on their own lines and aligned vertically* with each comment line preceded by an "*" like this*/
The third style he likes is only for single lines.

I glossed over the "Or many" part and missed it, my bad.

I like this style:
/* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam facilisis * ut orci non vehicula. Phasellus placerat magna nec diam malesuada bibendum. * Aenean luctus mauris vitae quam ornare, at maximus nisi placerat. * Suspendisse imperdiet diam dui, at dignissim arcu sodales ac. Duis vel sem * erat. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur * ridiculus mus. Maecenas a tellus convallis, rutrum urna non, interdum felis. * Fusce tempor mi et nunc tincidunt, in consequat ante sagittis. Pellentesque * mauris libero, rhoncus nec ligula sed, semper auctor ante. In consectetur * quam sed consectetur porttitor. */
The closing */ can also go at the end of the last line.

/thread

You are suddenly aware you could read an anonymous comment from Linus on hatechan and not notice anything out of the ordinary with it

Reminder

...

...

Wrong thread?

Yes. Was meant for this one

I don't like this style because the asterisks aren't vertically aligned, but I do like that the /* and */ start a line above and below the comment body.

I like that the asterisks are vertically aligned in this example, but I don't like that the /* starts at the same like as the comment and not the line before.

/* * Basically, this is what I want to see when * I see a comment in some code. */

The style you posted is what the kernel already does; the one with misaligned asterisks is a mistake propagated by retards in here who keep linking to HTML-formatted misquotes of the mailing list which rape the correct formatting.

...

...

What's your opinion of
if(foo) { bar(); }
?


/shed

Why are these articles always titled 'Linus Torvalds swears' instead of 'Kernel Developer Writes Shitty Code, Gets What He Deserves'?

Because there's a campaign to paint Linus as an abusive misogynist bully who insults and oppresses strong independent female and minority programmers, and all of these "Linus did something mean!" articles help to push that.

This article doesn't exaggerate his behavior. If anything it understates it because it implies that it's unusual for him to talk like this.

how about this cancer
/*********//*NIGGER*//*********/

Before I say anything else, let me just get this out of the way first OK?

Torvalds is a dick. Don't be a dick Torvalds.

This is awesome

Good man.

get out

Visually unbalanced

Because The Register is just a chav version of Gawker

>/* Commentreadability is unimportant*/

I don't think that, but I think most of the discussion is pointless. As long as the style isn't completely retarded and everyone follows the same style guidelines it doesn't matter what the style is.

...

Looks p visually balanced to me fam :^)

well luckily we also have semicolons

...

oh no people write comments in a way some irrelevant faggot doesn't like

make it easy (neovim/vim)

github.com/scrooloose/nerdcommenter

I've always stuck to double forward slashes.

Semicolons are also used in a non-statement context though.

once again the only programming concept Holla Forums can discuss is syntax nitpicking

the_fox_and_the_grapes.jpg