Re:The tyranny of the Hollerith punched card
by strictnein on Monday June 06, 2016 @11:11AM
(#11847335)
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.findUserBySomething", Long.class);
You're only reading the "User.findUserBySomething". The rest of it is mainly fluff.
Re:The tyranny of the Hollerith punched card
by lukeschlather on Monday June 06, 2016 @12:13PM
(#11847840)
Just for the record, that bit of code gets cut off at ", Long." for me, and then there's a scrollbar. (I always read HN zoomed-in.)
Re:The tyranny of the Hollerith punched card
by jdbernard on Monday June 06, 2016 @01:52PM
(#11848742)
There's a CSS rule constraining the width of <pre> blocks to 600px.
Re:The tyranny of the Hollerith punched card
by jdbernard on Monday June 06, 2016 @01:56PM
(#11848782)
Personally I find that second line annoyingly long and would split it for readability's sake.
Re:The tyranny of the Hollerith punched card
by jahewson on Monday June 06, 2016 @11:29AM
(#11847482)
Most of this line length theory isn't backed up by any science. Newspapers are a particularly poor example as their line lengths are typically much too short to provide "good" readability.
It's also worth noting that newspapers traditionally used columns because they allow individual articles to be typeset and then divided into pieces later during composition. Not because they offer some kind of readability advantage.
Re:The tyranny of the Hollerith punched card
by Nano2rad on Monday June 06, 2016 @01:23PM
(#11848456)
Maybe 80 is standard for code. Newspaper may have another ergonomic standard, also bible.
Re:The tyranny of the Hollerith punched card
by penguinduck on Monday June 06, 2016 @12:14PM
(#11847845)
Newspapers can be extremely unreadable though for this exact reason. They often use 30 character columns, then have an article consisting of 5 or more such columns of text. I often "get lost in the sentence" when reading this format and have to backtrack. It would be interesting to know why they do this. It is definitely not readability.
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...
For the same reason, newspapers use multiple columns, even though the paper itself would allow for 200-character lines.