Re:Airbnb JavaScript Style Guide
by greyskull on Friday July 03, 2015 @01:52AM
(#9823767)
Genuine question: Do people still adhere to 80 character limits for lines? I expected that everyone would have relaxed those with all the extra resolution we have. I use 100 at work.
[ Parent
| on HN ]
Re:Airbnb JavaScript Style Guide
by allannienhuis on Friday July 03, 2015 @10:42AM
(#9825829)
I often switch between working on my desktop and my laptop. keeping to a limit of about 80 characters makes it easier when working on the laptop. And as others have said, I often split screens when working on my desktop as well, so it helps there too.
I also find that very long lines can be a code smell - deeply nested callbacks or a case of 'divitis' in html markup.
When working with html, I find it convenient to put attributes on separate lines if there are more than a couple of short ones. This naturally helps keep line length down. Having them on separate lines helps with editing a bit too.
Re:Airbnb JavaScript Style Guide
by lucaspiller on Friday July 03, 2015 @03:21AM
(#9824031)
I like using split panes in my editor: When I'm not at my desk, I can just fit two 80 character panes in. When I'm at my desk I can fit three!
I don't follow it religiously, but I try and fit everything into 80 characters where possible (my editor has an indicator for the 80-character mark).
Re:Airbnb JavaScript Style Guide
by atinoda-kestrel on Saturday July 04, 2015 @10:38AM
(#9830269)
For me the big win with 80 is that I can easily do a side-by-side diff in my IDE without needing to expand the diff window at the expense of the outline, package, and other views. And horizontal scrolling in a diff view sucks. A lot.
Re:Airbnb JavaScript Style Guide
by mixmastamyk on Friday July 03, 2015 @04:00AM
(#9824181)
Agreed, also I like to have a portrait monitor for code and browser, can see more without scrolling, so 80 helps.
I keep a ruler at 80char but treat it as a soft limit. It seems to work okay, functionally its probably about the same as a 100char limit but there's something psychologically better about being able to break the limit and not worry about it.