Talk:Indent style

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Computing (Rated C-class, Mid-importance)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
C-Class article C  This article has been rated as C-Class on the project's quality scale.
 Mid  This article has been rated as Mid-importance on the project's importance scale.
 

GNU indent[edit]

I find it odd that this article does not discuss mixing tabs and spaces. Anyway, do you agree with the statement that emacs indents with two spaces? Last time I tried emacs 23.3.1 it used by default tabs instead of 8 spaces, while still indenting with two spaces at the beginning (first three indent levels). --146.211.0.10 (talk) 14:19, 17 December 2013 (UTC)

I added a mention of Emacs's ability to indent using tabs followed by spaces, resulting the the minimal number of indentation characters. — Loadmaster (talk) 18:09, 17 December 2013 (UTC)

Praise[edit]

I came to this page because I am updating some code code I first published to comp.sources.unix 26 years ago, and I needed to decide on how to best modernize my indentation. This entire article is impressive even though it is not perfect. Best for this comment to remain anonymous. — Preceding unsigned comment added by 198.0.155.131 (talkcontribs) 14:30, 28 March 2014 (UTC)

Kernel example[edit]

I think the Kernel example should be modified to not include an else branch with the preceding if branch unconditionally returning. This pattern is actively avoided in the kernel sources. It has been mentioned quite a few times over the years on lkml. — Preceding unsigned comment added by 62.116.255.28 (talk) 11:59, 9 April 2014 (UTC)

Fixed.  Stepho  talk  05:27, 4 August 2014 (UTC)

What about coding styles omitting a space after the parenthesis?[edit]

I noticed that all coding styles mentioned on this page that do not involve a new line for the curly brace do this if(example) { But why no mention of something like this? if(example){ Should this article cover that coding style? — Preceding unsigned comment added by Sonic12228 (talkcontribs) 03:41, 4 August 2014 (UTC)

I would just add a note to each of the affect styles to say that the space between the ')' and the '{' is optional. Similar for '} else {' and '}else{' .  Stepho  talk  05:17, 4 August 2014 (UTC)

What is the Linux kernel written in?[edit]

From the article, it appears that the Linux kernel is written in Kernel style, but the OTBS variant of K&R says that it's written in that style. Are they really the same? Only the OTBS section has citations.