5 ms·
80. It shocked me to learn that some people don't hard-wrap their code at all. I ran into some github repository with comments which went on for 200+ characte
by rachelbythebay 14y ago
80. It shocked me to learn that some people don't hard-wrap their code at all. I ran into some github repository with comments which went on for 200+ characters and couldn't figure out what kind of maniac would inflict that upon the world.
I wrote a post about it which generated some responses, and it seems IDEs are to blame. Once you get into some of those environments, keeping things (relatively) narrow for the sake of others might just go out the window.
I covered it here, including a screenshot of what a typical dev session for me looks like: http://rachelbythebay.com/w/2012/08/31/lines/ http://rachelbythebay.com/w/2012/08/31/lines/
- DrinkWater 14y agoAre you serious with these green terminal sessions? Wow....my eyes
- rachelbythebay 14y agoYes. My monitor can be astonishingly bright with other settings. I used to do black-on-white in the past, but that was on a different display which wasn't quite so powerful.
- ramblerman 14y agoI can follow your aversion to IDEs (to each his own). But foregoing a nice font and some basic syntax highlighting just seems masochistic.
- rachelbythebay 14y agoTo each her own, too. For me, that is a nice font -- "9x15". It's one I deliberately selected instead of whatever the default would be. Syntax highlighting drives me nuts, so I don't use it.
- eduardordm 14y agoWhen 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'.