The Teletype Model 33 – And the Curse of line breaks

Ever wonder why \r\n still haunts us like a ghost in your text files?

This machine — the Teletype Model 33 — is often blamed for why Windows and Linux have never quite agreed on how to break a line of text.

Back in the day, printers, keyboards, and punched tape were cheaper than screens and hard drives. The affordable Model 33 sold in huge numbers during the 60s and 70s and was one of the first machines to use the ASCII character set. That popularity is probably why we still use ASCII-encoded text today. UTF is just an extension of ASCII. I think I remember seeing a Model 33 at my mom’s office when I was little — too young to be sure, but maybe that’s where my fascination with computers began.

Where Newline Starts Getting Weird

The trouble starts with line breaks. Unix systems like Linux use the ASCII character LF (Line Feed, code 10) to indicate that the next bit of text should go on a new line. We programmers often write this as \n. I suspect that name — “newline” — came from IBM mainframes using EBCDIC, which actually had a newline character. But on early Apple and Commodore systems, people used \r (Carriage Return, ASCII 13) instead. It was all a bit of a mess.

Thankfully, converting between \r and \n wasn’t that hard — just translate between them and move on.

Windows decided to use both characters — \r\n — to represent a line break. And that decision has been tripping us up ever since. Suddenly you have to deal with two characters instead of one. Is it a line break or just a carriage return? Today, almost every modern system (mobile, laptop, server) just uses \n, and even Windows is finally starting to accept that. But historically, Windows apps couldn’t make sense of a simple \n. On Linux, life was a bit simpler.

Why It Took Two Characters

The Model 33 wasn’t just cheap — it was blazingly fast. A full 10 characters per second. But there was a catch. It took about 0.2 seconds for the print head to move back to the start of the next line. Without fancy control circuitry, that meant your next line’s first character might end up halfway across the page. The signal reached the print head while it was still in motion.

So people started sending two characters: CR (carriage return) to move the head back, and then LF (line feed) to advance the paper. Some even added extra carriage returns, just in case — like a safety net. Expensive printers at the time only needed LF, but the 33 needed both.

Was LF originally meant just to advance the paper without moving the head? I’m not sure, but there were definitely printers that did that. I also remember using just CR to overwrite or underline text on line-oriented printers.

Drivers and Legacy

In Multics, the ancestor of Unix and Linux, the terminal driver would automatically insert a carriage return before each newline — if you were using a Model 33 as your terminal.

But CP/M, the ancestor of Windows, had far fewer resources. It was built for tiny machines, often without screens or drivers. So supporting the 33 with \r\n was an obvious choice.

Even when Windows became a real operating system — an incarnation more like VAX/VMS than CP/M when NT arrived — the \r\n stayed. Tradition dies hard.

Telex, HTTP, and Internet Ghosts The 33 wasn’t just used for talking to computers — it was also a teleprinter. A kind of text-over-telephone system. Telex, really, was the ancestor of the internet.

And strangely enough, when you fetch a web page today, the HTTP headers still come back with \r\n line endings. Even though the internet as we know it was born on Unix machines using just \n. But I guess when those first IP packets were being routed, someone still wanted to support those beloved old 33s.

Flow Control and Drum Machines

Even flow control characters like XON and XOFF (also known as DC1 and DC3 in the ASCII table) come from the Model 33.

What if, instead of using \r\n, we had just added an LF followed by XOFF, then XON again — to buy the print head time to return? The history of line endings might’ve been very different.

I remember we once turned a daisywheel printer into a primitive drum machine and made it play Blue Monday at school. If I remember right, we used XON and XOFF — along with carefully chosen characters — to tweak the speed of the spinning wheel and nail the rhythm.


All #art #clojure #csharp #data-structures #database #datomic #emacs #functional #haskell #history #immutability #java #jit #jmm #lambdas #lisp #pioneers #poetry #programming #programming-philosophy #randomness #rant #reducers #repl #smalltalk #sql #threads #women