4 ms·
The largest collaboratively maintained source tree on the planet (that I am aware of) is the Linux Kernel. Just submit a 'badly' formatted piece of code to some
by unmole 14y ago
The largest collaboratively maintained source tree on the planet (that I am aware of) is the Linux Kernel. Just submit a 'badly' formatted piece of code to someone like Greg Kroah-Hartman and see what happens.
Quoting a formal study[1]:
"It is not merely a matter of aesthetics that programs should be written in a particular style. Rather there is a psychological basis for writing programs in a conventional manner: programmers have strong expectations that other programmers will follow these discourse rules. If the rules are violated, then the utility afforded by the expectations that programmers have built up over time is effectively nullified."
[1] Soloway, Elliot, and Kate Ehrlich. 1984. “Empirical Studies of Programming Knowledge”, IEEE Transactions on Software Engineering SE-10, no. 5 (September): 595-609
[2] http://goo.gl/2bHwq http://goo.gl/2bHwq
- mpyne 14y agoThe kernel is actually not that large, all things considered (and why should it be, it's the freaking kernel). Although, it certainly seems the largest "professionally-engineered" source tree that I can think of. Greg's paper has a funny quote that's worth drilling out: "The original authors of UNIX placed their braces with the opening brace last on the line, and the closing brace first on the line, like: if (x is true) { we do y } Because of this, the kernel will be written in the same style." The reason is still arbitrary but I can certainly respect why that arbitrary decision is better than others.
- taeric 14y agoMy point was more that I would wager most "auto styler" tools will change code that is in the kernel. You are really just bringing up more of what I consider "straw men" in this argument. Terribly formatted code is of course terrible. Much of what folks argue about being "good code" is just nitpicky wastes of time. Take this snippet from the kernel: if (pages) { pages[i] = virt_to_page(start); if (pages[i]) page_cache_get(pages[i]); } if (vmas) vmas[i] = vma; This is just an arbitrary snippet, as I really have no familiarity with the code. But, alone in this snippet I already see at least two things that would make most format obsessed people go stupid. (Three in the actual code, but I don't know if the tabs will be visible to folks on this forum.) Edit: I forgot to add that I realize this segment actually conforms to the linux style guide. So... yeah, doesn't really say much other than to show that the kernel crew disagrees with most anyone you will ever hear online. It does not take too much effort to find snippets that actually do violate their own rules.
- JoeAltmaier 14y agoAstonished. Read the linux kernel some years ago; absolute maze of mis-named structures and duplicate code. Horrifying, I left as soon as I could. And now I learn there's supposed to be some coding standard?