On 08/08/2012 11:07 AM, Mark Holmquist wrote:
Also, "it should be 4 spaces" is a matter of opinion--everyone likes different tab widths depending on their preferences and monitor size.
http://www.mediawiki.org/wiki/CC#Tab_size
"you should make no assumptions" appears to support Chad's statement. However, I'm pretty sure that in reality, many people assume a width of 4. I've definitely seen funky tab-plus-space indentations that support that theory.
I officially redact my bogus claim that it "should" be 4 spaces. However, we certainly shouldn't default to 8!
I use 8 :P
(Seriously though, everything looks so crunched up with 4 space tab width... Makes me claustrophobic!)
-bawolff
8 Август 2012 г. 22:43:15 пользователь bawolff (bawolff+wn@gmail.com) написал:
I use 8 :P
(Seriously though, everything looks so crunched up with 4 space tab width... Makes me claustrophobic!)
Tab 8 encourages to make less "structural nesting" like foreach( if ( foreach ( if () ) ) ) in one method, because such lines would become too long. Instead there will be large amount of smaller functions / methods. But there should be the middle balance between "large method which does a lot" and "lots of extremly tiny methods nested calls". Perhaps Tab 4, I do not know.
Sadly the length of lines is a poor measure of the nested-ness of a program, and sufficiently complex algorithms aren't always better broken into multiple parts, such as in cases where the loops are very tight and the function call overhead would be costly.
- Trevor
On Wed, Aug 8, 2012 at 11:09 PM, Dmitriy Sintsov questpc@rambler.ru wrote:
8 Август 2012 г. 22:43:15 пользователь bawolff (bawolff+wn@gmail.com)
написал:
I use 8 :P
(Seriously though, everything looks so crunched up with 4 space tab width... Makes me claustrophobic!)
Tab 8 encourages to make less "structural nesting" like foreach( if (
foreach ( if () ) ) ) in one method, because such lines would become too long. Instead there will be large amount of smaller functions / methods. But there should be the middle balance between "large method which does a lot" and "lots of extremly tiny methods nested calls". Perhaps Tab 4, I do not know.
______________________________**_________________ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/**mailman/listinfo/wikitech-lhttps://lists.wikimedia.org/mailman/listinfo/wikitech-l
On Wed, Aug 8, 2012 at 11:09 PM, Dmitriy Sintsov questpc@rambler.ru wrote:
Tab 8 encourages to make less "structural nesting" like foreach( if ( foreach ( if () ) ) ) in one method, because such lines would become too long. Instead there will be large amount of smaller functions / methods. But there should be the middle balance between "large method which does a lot" and "lots of extremly tiny methods nested calls". Perhaps Tab 4, I do not know.
Personally, I think if changing tab widths causes you to change your code *functionally*, you're putting wayyyy too much thought into how pretty your code is. Code should be legible, but not at the expense of writing good code to begin with.
Anyway, as I said earlier--we're not going to hack Gerrit just to change this, so this thread is really going nowhere.
-Chad
wikitech-l@lists.wikimedia.org