4 ms·
When I code C for embedded hardware, I agree 80 is more than enough, but that's because that is a simple language and the artifacts always lead to smaller width
by eduardordm 14y ago
When I code C for embedded hardware, I agree 80 is more than enough, but that's because that is a simple language and the artifacts always lead to smaller widths.
Now, try that in C++. You can loose 10+ chars to indentation (namespacing, etc) alone. I think the 80 chars puritanism is just plain idiotic, specially in some languages like Obj-C.
Take this kind of bureaucratic crap:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(whateverChanged:) name:UITextViewTextDidChangeNotification object:nil];
If you start hard wrapping every long call you find you will end up with incredibly long files, filled with framework crap instead of useful information.
- jdavid 14y agojavascript can have a lot of indents with all of the closures, so ... in those cases I might set the indent spacing to 2. I still think that it's just common good manners to keep code to 80 chars, those languages should work better to not be so verbose.
- rizwan 14y agoAnd yet, Google's Objective-C style guide (adopted by many) is uncompromising in its 80-character line length: http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml?showone=Line_Length#Line_Length http://google-styleguide.googlecode.com/svn/trunk/objcguide....
- eduardordm 14y agoUtter BS. "... We realize that Objective C is a verbose language and in some cases it may be more readable to extend slightly beyond 80 columns, but this should definitely be the exception and not commonplace" Edit: One single attribution that crosses the 80 columns rule (4 levels of indentation - 4 spaces each) placeHolderLabel.lineBreakMode = UILineBreakModeWordWrap; The person who wrote that is obviously not fluent in Obj-C and even says the rule is 'controversial'.