dark mode light mode Search Menu
Search

Punched Card Programming

dullhunk on Flickr

If you’ve dabbled in programming, you’ll know that confusing things come up. Perhaps the compiler didn’t like the code you wrote, or a bug appeared in your program and you have no idea where it came from. It’s annoying, but not nearly as complicated as it used to be.

Let’s turn the clock back, say, 50 years, to the 1970s. If you wanted to program something, there was no keyboard or app. Instead, you had to use punched cards. Approximately the size of a dollar bill, these punched cards had to be fed into the computer, which would read them and write the results to an internal file. To add more data, just feed in more cards.

A punched card had repeating columns of the same string of numbers across its width. The idea was that, if you wanted the computer to read a specific character, you punched a hole in that character and the computer would read it. If you wanted something other than a number, like a letter (which is pretty important for programming), the computer would read two holes at the same time.

For example, you could set it so if the card was punched on slots 1 and 2 in the same column, that ‘translates’ to the letter ‘A’.

Bunches of Punches

Punch cards were created with a typewriter-like device. The user would slip a card into the card puncher and type out their code on its keyboard. The device would then punch holes in the cards related to what was typed. Some fancy models even printed the character at the top of the card, so you could see what each card did.

Here’s where things get hairy. Each card could hold only enough information for a short line of code. If you wanted to make a new line of code, you needed a new card. So, programs were not stored on just a handful of cards, but in giant decks that you had to feed into a computer one by one.

Can you imagine what those programs looked like? Just a thick stack of cards, in code line order, and swapping any of the cards could mean the program wouldn’t run. Think of the hours spent on reassembling the program after someone dropped all their cards on the floor. You’d have to know your program pretty well to assemble the cards in the right order again.

Missed Key Misery

As you might imagine, this system had its fair share of flaws. For one, the system wasn’t very forgiving when it came to typos. Once a column had been punched in, that’s that; no amount of backspacing or white-out could remove it. Hopefully, you would catch this problem during the card’s creation, otherwise, you’d have to go through each card, one by one, to spot the typo after the program failed to run.

Given how all your code is on physical cards, it’s a good idea to keep backups of them. Of course, that means making even more cards identical to the ones you just made, so that means typing out hundreds of new cards and not making any mistakes on those ones, either.

All in all, coding in the 1970s was a tricky business. It’s surprising people even had the patience to make programs back then. So the next time your program fails because you typed one equals sign instead of two, just breathe a sigh of relief that you don’t have to go through a deck of 100 cards just to find it.

learn more

Programming by Card

https://hackaday.com/2022/11/09/retrotechtacular-programming-by-card/

Punch Cards and Data Processing

https://www.si.edu/spotlight/punch-cards/punch-cards-data-processing

Programming in the Punch Card Era

https://en.wikipedia.org/wiki/Computer_programming_in_the_punched_card_era

Punch Cards

https://www.computerhope.com/jargon/p/punccard.htm

What are Punch Cards in Early Computers?

https://www.computermuseumofamerica.org/2022/09/16/what-are-punch-cards-in-early-computers/

From Punch Cards to the Cloud

https://artsandculture.google.com/story/from-punch-cards-to-the-cloud-museum-for-communication-frankfurt/VQXBq16p7orTYw?hl=en

Do Not Fold, Spindle, or Mutilate

https://repository.library.brown.edu/studio/item/bdr:788264/PDF/