News for hackers. Stuff that matters.
Re:Airbnb JavaScript Style Guide by viraptor on Friday July 03, 2015 @01:24AM (#9823675)
I can see both sides. I hate it when code is all over the place, different files indented in different ways, no consistency on bracket placement, etc. But then again, I just hate it when rules grow so strict you can't ever break them. For example when line like this in strictly-pep8-compiliant codebase:

    return "some very long string"
is exactly 81 characters long. I'd much rather place some "# ignore this" comment on it than break a line there, forcing a "\" after return.
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.
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.
Re:Airbnb JavaScript Style Guide by notatoad on Friday July 03, 2015 @04:14AM (#9824245)
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.
Re:Airbnb JavaScript Style Guide by viraptor on Friday July 03, 2015 @02:48AM (#9823932)
Yes. Some almost religiously.
Re:Airbnb JavaScript Style Guide by reagency on Friday July 03, 2015 @02:27AM (#9823872)
Every sane linter has //NOLINT support.
Re:Airbnb JavaScript Style Guide by viraptor on Friday July 03, 2015 @02:49AM (#9823934)
Yes. But not every code reviewer has a //NONITPICK option.