Skip to content

Comment on The history of curly bracesparent

Comments

The first 32 ASCII code points are literally control codes, which are used to interface with computer hardware that makes use of ASCII - for example teletype machines.

To that extent, it's very much worthwhile to have a control code for a carriage return - setting the cursor to the start of the line without advancing to a new one. This lets you, for example, tell an electronic typewriter to double-strike a line for a boldface effect, or strikethrough a line of text.

And once you have that, you might as well have the control character that advances the output to the next line not move the cursor at all, since the operator can just send a carriage return if they do want to start at the beginning of the next line instead of where they left off on the previous one.

With regards to bitness, computers weren't always strictly power-of-2 based (quick example: the PDP-8 was a 12-bit machine). While today, memory is cheap enough that "rounding up" 30 bits to 32, or 7 bits to 8, is definitely worth it in terms of how it simplifies your other logic, back when ASCII was developed that wasn't really the case.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.