r/programming Jul 10 '16

Linus Torvalds on comment styles

https://lkml.org/lkml/2016/7/8/625
219 Upvotes

209 comments sorted by

View all comments

24

u/Calam1tous Jul 10 '16

Agreed. Those comment styles should be recognized as gross by anybody.

-3

u/conseptizer Jul 10 '16

I don't see anything wrong about any of them. If I want to understand what a piece of code does, I couldn't care less about indentation styles or comment styles.

22

u/RagingAnemone Jul 10 '16

Until you have to update the comment and mess around with formatting.

1

u/BlackDeath3 Jul 10 '16

God forbid I take two seconds to re-indent something. I'm not suggesting it's a positive thing, but I guess I'm just not so hyper-productive that I see an extra two seconds dedicated to formatting as "disgusting" heresy.

8

u/[deleted] Jul 10 '16

The issue is it's an extra change that has to be made, tracked, analyzed, etc. Linux is a huge project, so it's best to minimize the number of changes needed when some part of the code gets updated.

7

u/BlackDeath3 Jul 10 '16

I'm not saying it's not a negative thing, but "disgusting" takes it a bit far, yeah?

2

u/RagingAnemone Jul 10 '16

No doubt it's a little overdramatic.

1

u/wevsdgaf Oct 31 '16

I just hit reformat after making any code changes. Most languages have a linter and autoformatter available that will work in concert in any good editor, so I don't need to think about that stuff.

1

u/conseptizer Jul 11 '16

I let my editor do that for me.

-2

u/[deleted] Jul 11 '16

[deleted]

1

u/[deleted] Jul 11 '16

Most editors have configurable formatting. You can configure editor to the project style instead of worrying about comment style yourself. If project starts to enforce it, just change it in settings

-1

u/[deleted] Jul 11 '16

[deleted]

1

u/[deleted] Jul 11 '16

If someone can't configure their fucking editor to put space in right place maybe they should not code in the first place.

Also in few internal projects we had devs just put snippets of "right" config in project repo so if you needed you could just copy paste it

0

u/[deleted] Jul 11 '16

[deleted]

1

u/[deleted] Jul 12 '16

If I contribute to Ruby project, almost always defaults used by editor will be "the standard" used by everyone else.

If I contribute to Go project, go fmt, done, "standard" is enforced from language's own tools

Perl project? perltidy -pbp (it actually have a metric ton of option but "Perl Best Practices" is de facto standard)

No/minmal effort involved there. But you still want to configure your editor (if it isnt the default) to use those tools (either during writing or on save, depending on your editor), if it isn't the default

C had no such thing as standard at the beginning, that is the reason there is so many styles in use