The article has the causality backwards. We don't use 80 characters because that's what the Hollerith card used, the Hollerith card used 80 characters because that's a good ergonomic width. (Or, if you prefer, the Hollerith card succeeded because it was a good ergonomic width.) Coincidentally (or perhaps ironically) the article itself is formatted for ~80 characters per line, not because it's bound by the Hollerith c…
Also the author seems to have missed that this char limit is changing. In Python, for example, an official style guide update in 2013 [1] allows for 100 char line length. [1] https://www.python.org/dev/peps/pep-0008/#maximum-line-lengt...
The tyranny of the Hollerith punched card
61–70 of 148 posts
Re: The tyranny of the Hollerith punched card
#6280 is an _awful_ width for code in a programming paradigm encouraging long variable names. If you're comparing two values from class.accessor, you fly right past 80 characters if you have any indentation at all. Namespace hierarchies pretty much put you over the limit if you use named constants in your constructors. If you actually use long/descriptive variable names, you can mentally process much wider text quickly,…
foo = bar(baz, qux)
myClassInstance.someWritableVar = lib.someFunction(param1, MyOtherClass.constants.FOO)
The second line is well over 80 chars, but may be as understandable as the first.Re: The tyranny of the Hollerith punched card
#63Earlier quoted context omitted.
80 characters seems really narrow. IDEs like IntelliJ put a guideline at 120 characters, which basically allows two full width editing windows side by side (depending on your font size) at the pretty standard resolution of 1920x1080. We've all got widescreen monitors now, right? So it makes sense that people are going well past 80 characters.
80col is narrow for Java because Java has very long method names, explicit tyle declarations, and class names on static methods.
[1]: https://tkware.info/2016/05/08/a-case-for-increasing-pep8-li...
Re: The tyranny of the Hollerith punched card
#64When compatibility is a burden, people do work hard to break it.
Anyway, there's a "(2012)" missing on the title, and even that makes the article kinda late to the discussion. By that time, most people already didn't care about the 80 lines limits.
Re: The tyranny of the Hollerith punched card
#6580 is an _awful_ width for code in a programming paradigm encouraging long variable names. If you're comparing two values from class.accessor, you fly right past 80 characters if you have any indentation at all. Namespace hierarchies pretty much put you over the limit if you use named constants in your constructors. If you actually use long/descriptive variable names, you can mentally process much wider text quickly,…
Which is exactly why all such paradigms are _awful_.
Re: The tyranny of the Hollerith punched card
#66Earlier quoted context omitted.
As another commenter noted, it's not (just) about screen width. It's about having a text width that allows your eyes to track both column boundaries as achoring points. If a text is too wide, your eyes will have trouble finding the start of the next line. For the same reason, newspapers use multiple columns, even though the paper itself would allow for 200-character lines.
I don't think we read code the same way we read normal text. If you have this in your code: qry.setParameter("a", a); qry.setParameter("b", b); qry.setParameter("foo", foo); qry.setParameter("bar", bar); After the first "qry.setParameter" you're no longer reading anything but the parameters and your eyes are moving vertically. Or if you have something like this: Query qry = getEntityManager().createNamedQuery("User.f…
Re: The tyranny of the Hollerith punched card
#67Earlier quoted context omitted.
80 characters seems really narrow. IDEs like IntelliJ put a guideline at 120 characters, which basically allows two full width editing windows side by side (depending on your font size) at the pretty standard resolution of 1920x1080. We've all got widescreen monitors now, right? So it makes sense that people are going well past 80 characters.
As another commenter noted, it's not (just) about screen width. It's about having a text width that allows your eyes to track both column boundaries as achoring points. If a text is too wide, your eyes will have trouble finding the start of the next line. For the same reason, newspapers use multiple columns, even though the paper itself would allow for 200-character lines.
I think on a mental level, the problem is that when the lines are this short, the grammar is extremely broken up, so you need to "cache" 4-5 lines of context to understand anything. When it's 80 per line, lines are parsed in a more independent fashion.
I think 70-100 is perfect, depending on other factors.
Screenshot of what I mean: http://www.trbimg.com/img-5667d3f6/turbine/la-la-na-menace02...
Re: The tyranny of the Hollerith punched card
#68Out of curiosity, where did the 132 column standard (for wide carriage printers) come from (why 132, not 130 or 120)?
Likely because of the VT100: http://vt100.net/docs/tp83/chapter5.html > 132 column × 14 lines (VT100, VT101, VT125) display > Allows you a larger format for detailed or spread sheet work so you can preview reports prior to printing. (Note: The advanced video option, which is standard with the VT102 and VT131, provides 132 column × 24 lines display.)
"10 pixels wide for 80 columns, 6 pixels wide for 132 columns."
If their baseline was 800 pixels (80 cols * 10 pix/col) then 132 is the largest number of columns fitting into 800 pixels at 6 pix/col.Re: The tyranny of the Hollerith punched card
#69This is one of my major pet peeves Except for Linux Kernel people (who actually have to work and debug stuff in the builtin 80x24 screen) there is no excuse for not using something bigger Having to break a line because it's 81 characters and your linter is going to complain is completely and utterly ridiculous It's 2016. How long since the first IBM PC again? Yes, it's a tyranny. I don't care if the average is around…
Re: The tyranny of the Hollerith punched card
#70Earlier quoted context omitted.
I've seen code where 20-odd characters were taken up by whitespace. Of course, at that point, you really want to split it out into different, named functions... code like that is unreadable for entirely different reasons than line lenth. Similar things the case for almost every single case where a line might become "too long" - I don't think the length is actually the issue so much as the complexity.
but "20-odd" (let it be 24) is just 3 * 8, which is something like this. I don't see how this is already screwed up for complexity. class A { A::a() { if (expr) { do1(); } else { do2(); } } }