Live data from Hacker News

The tyranny of the Hollerith punched card

pub.gajendra.net

101–110 of 148 posts

Re: The tyranny of the Hollerith punched card

#101
post #94
post #92

Earlier quoted context omitted.

> Including class variables? You mean field names? A paradigm where you have such a thing is _awful_. Seriously. And this is exactly one of the reasons why it is awful and why it leads to an unreadable and unmaintainable code.

Are we anti-OOP then? And no, I don't believe you. Making your variable names more descriptive does not make your code less readable. Even when it's not strictly necessary, it's not harmful to comprehension UNLESS you refuse to move from a completely outdated line width. Some people argue that it takes longer to type and edit. But as we all know, we spend far more time reading than writing code, and modern editors (l…

It takes longer to read, and this is what is important.

And, yes, OOP is a filth.

Re: The tyranny of the Hollerith punched card

#102
post #81
post #75

Earlier quoted context omitted.

I researched Hollerith cards and 80-character lines in excessive detail while studying card sorters [1]. The Hollerith card is the root cause of 80-character lines, of course. Prior to 1928, Hollerith cards used round holes and 45 characters per card. IBM wanted to fit more data on a card and investigated two alternatives: binary coding so 90 characters could fit into 45 columns of holes, or rectangular holes which a…

The facts you cite are true, of course, but it does not follow that the H-card was the cause of 80-character lines. We've had plenty of opportunities to ditch that standard if we wanted to. The Apple II had 40 characters per line. That went by the wayside not because there was a compelling reason to be backwards-comatible with H-cards, but simply because 40 characters is too short. When longer lines were enabled by t…

You could buy an 80 column card for your Apple II. It usually needed to be turned off for games and such that were depending on the 40 column format, but that was hit or miss.

Re: The tyranny of the Hollerith punched card

#103

Earlier quoted context omitted.

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…

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.)

There's a CSS rule constraining the width of
 blocks to 600px.

Re: The tyranny of the Hollerith punched card

#104
post #89
post #14

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…

I'm seeing a general push for longer lines. I no longer religiously hold Java code at 80 personally.

I use the rule "if it fits on my screen then it's not too long". And if your code doesn't fit on my screen, I might break the line and commit.

Re: The tyranny of the Hollerith punched card

#105
post #22

Earlier 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…

Personally I find that second line annoyingly long and would split it for readability's sake.

Re: The tyranny of the Hollerith punched card

#106
post #46

Earlier quoted context omitted.

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(); } } }

I think most people have converged to 4 space tabstops, so 24 spaces means 6 levels of indentation.

Namespace, class, method, loop, conditional brings us to 20.

Re: The tyranny of the Hollerith punched card

#107

Apologies for being somewhat off topic, but does anyone know where I can go these days to get some cards punched (for a small museum display)? Given how common punchcards were, it has been difficult to find someone. Anyone out there have access to an old IBM 026, 029, 129?

The Computer History Museum in Mountain View has 026 and 029 keypunches. Go to the 1401 demo and they'll probably let you punch a card. Or let me know what you need punched and I'll see what I can do. What museum are you getting this for?

If you're in the bay area, you should go see the IBM 1401 demo; it's cool to see a punched card computer in operation. Demos are Wednesdays and Saturdays; schedule is http://www.computerhistory.org/hours/

Re: The tyranny of the Hollerith punched card

#108
Personally, I agree with the author and generally have argued against hard line-length limits. Today's computers have different screen characteristics than even 15 years ago and we're at a much greater loss of vertical length than horizontal length so it bugs me when I pull up code that has less-readable statements broken apart over ten lines, doing one thing, and leaving 80% of my screen empty when readability would have been improved by leaving parts of those ten lines on a single line.

I can understand the benefits, though, to having sane rules around "how much can go in one line", I just think the overall width of a line is of way lower importance than breaking things up into logical parts -- especially in C# in code that avoids LINQ statements[1] where method chaining can result in some extremely wide, difficult to parse, code. I write almost all of my software on a Widescreen 1080P display where vertical real-estate is vastly lacking and horizontal real-estate is greatly underutilized. I use a pragmatic approach over artificial hard barriers and the assumption that I'll be using my display to look at code the way I do 99% of the time - one or two code files on screen at a time (but almost always a single code file).

My code still tends to mostly prefer vertical orientation. I use these simple rules:

(1) Avoid same-line chaining (Even "ToList" or "ToArray" gets its own line). Line up the dots of the calls with the previous line's dot to make it easy to see it's a part of a chain. This results in "wider" code but makes that code able to be parsed quickly while not wasting vertical space.

(2) Avoid more than one statement per line (conditionals excluded where readability requires -- doing if (isThis && isThat && string1==string2 && string3==string4) would put the two string comparisons on two separate lines usually).

(3) Omit (yes, omit) braces for single statements that don't have indented single statements below them. This gets me yelled at sometimes, but my IDE enforces code formatting for me, so the drawbacks of "accidentally having a statement appear to apply to a conditional that it doesn't" don't happen and with the lack of newlines-for-newlines'-sake in my code, code that's indented for branched statements is easily discernible from code that has a newline due to chaining or some other reason.

(4) Break the rules if readability is improved and avoid religious wars.

At the end of the day, I can live with nearly any code formatting ruleset. I read code more than I write it and I end up reading code that follows a large variety of rules so I try not to be a pain in the ass about it. If I haven't been the most substantial contributor to a project, I follow the other person's rules. If I have, I hope that they'll follow mine. The result has been few, if any, arguments over "tabs vs. spaces" theology.

[1] I have never liked the LINQ statement format as I find it hard to follow "What's Being Done" so I have, with rare exception, stuck with method chains.

Re: The tyranny of the Hollerith punched card

#109
post #28

Interesting fact: the Hollerith punched card is the same size as the dollar bill in 1890. This is because Hollerith was able to take advantage of existing stacking and sorting equipment already designed for banks. http://infolab.stanford.edu/pub/voy/museum/pictures/display/...

Strangely, punched cards are just a bit bigger than the old US currency, not exactly the same size. Also strange: nobody knows exactly how big the old currency was. To be precise, there are three slightly different sizes quoted as the official size. I asked the Bureau of Engraving and Printing about this - they print the money so they should know - and they couldn't explain the discrepancy.

Re: The tyranny of the Hollerith punched card

#110

Apologies for being somewhat off topic, but does anyone know where I can go these days to get some cards punched (for a small museum display)? Given how common punchcards were, it has been difficult to find someone. Anyone out there have access to an old IBM 026, 029, 129?

I'm not sure whether it will be of any practical use, but the Computer History Museum in Mountain View has an IBM 1401 on display, along with some IBM 026 card punches. They do demos of the hardware, and they'll sometimes punch little bits of data into cards, if you request it (my wife got our names punched in). I don't know about larger requests, like punching realistic program data into multiple cards, but it couldn't hurt to ask, right?

They've got contact info on their site: http://www.computerhistory.org/contact/

It may be worth it to send an e-mail to see what you could work out.

Post reply on HN