Hacker News new | ask | show | jobs
by IdontRememberIt 3042 days ago
(Controversial) Corollary resulting from this 16:9 domination: the maximum length of a source code line should be increased. 80 characters seems to be not the best fit for modern IDE on 16:9 screens. (I hate that, but praying for a 16:10 monitor comeback did not work. Also, it is getting worse with hidpi monitors)
3 comments

Again, I can't help but disagree with this. The reason newspapers arrange text in narrow columns is because it's easier to read, particularly if you're scanning quickly: same with source code.

A better approach I've found is to have files open side by side. On my old 17-inch MBP I used to edit three source files side by side. I can just about get away with this on my 15-inch retina model, but find two works better.

My Surface Book. is a bugger for this because, for one thing, the screen is smaller at 13.5", and then you also just don't have the horizontal real estate without reducing the font size slightly

No, all source code lines should be max 80 columns wide, always. That way, you can put a well-defined number of editor panes next to each other on the screen (3 columns on a 16:9, 2 columns on a 4:3). You're also able to print out snippets of source code on paper at 10pt font size.
...or 1.5 panes on a different 16:9, or 0.7 panes on a phone screen.

80 character limit sounds like it makes sense for order, but depending on size & eyesight, a lot of the screen may end up wasted.

    Personally, I hate nothing more than seeing lines wrapped like
    this when reading
    emails wrapped to 80 characters per line. This wastes vertical
    space, making the
    problem even worse.
Agreed. For me, 110 columns max seems to work best. I prefer longer, more descriptive variable names (taking into account the rule "larger scoper, longer name"). LLVM has an 80 lines rule and rarely variable names with more than three letters. This makes the code harder to read IMO.