News for hackers. Stuff that matters.
Re:Fixing C by paulddraper on Tuesday April 12, 2016 @01:22PM (#11481528)
YOUR ACTIONS SPEAK SO LOUD I CANNOT HEAR WHAT YOU ARE SAYING.

  git clone --depth=1 [email protected]:git/git.git
  find git -name '*.c' -type f | xargs grep -P '^( {4}|\t){4}' | wc -l
  11375

  git clone --depth=1 [email protected]:torvalds/linux.git
  find linux -name '*.c' -type f | xargs grep -P '^( {4}|\t){4}' | wc -l
  732937
Stupid shitty broken software. </s>
Re:Fixing C by bpchaps on Tuesday April 12, 2016 @03:02PM (#11482518)
Oh, stop :p

"$ find git -name .c -type f | xargs fgrep '{' | wc -l"

19288

"$ find linux -name .c -type f | xargs fgrep '{' | wc -l"

1408368

Re:Fixing C by ludamad on Tuesday April 12, 2016 @04:51PM (#11483471)
I'm confused, this is just counting starting braces no?
Re:Fixing C by Cpoll on Wednesday April 13, 2016 @01:34PM (#11490313)
I think the idea is that Linux has two orders of magnitude more loops, so one order of magnitude more 4-level-indentations is actually an improvement over Git's code, by ratio.

It's not as if Torvalds wrote the entire codebase by himself, anyway.

Re:Fixing C by paulddraper on Thursday April 14, 2016 @01:44PM (#11498865)
?

Git and linux were both written (originally) by Torvalds.

And both use a fair amount of deep indentation.

Re:Fixing C by bpchaps on Thursday April 14, 2016 @04:48PM (#11500223)
Right. I wasn't really commenting on whether git/linux were coded "correctly" in either case, just that it's not a very helpful metric for the larger conversation.
Re:Fixing C by paulddraper on Thursday April 14, 2016 @11:41PM (#11501937)
Fair enough. And my (flippant) comment was on two very large, very successful projects written predominantly in C with thousands of contributors.

Whether >3 level of indentation is "good", IDK. But it happens a lot. And I'm a practical man.