In the words of my combinatorics professor, Dave Bayer: > It is hard to shed prejudices about how code should look, even if learning to see clearly past convention is the only good reason to be a mathematician. I'm already quite sure how I will die: I'll read another article on Hacker News about a new programming language where I see nothing new, and I'll read that they included {}; to make C programmers comfortable.…
Curly braces: An evolution of Unix and C
11–20 of 29 posts
Re: Curly braces: An evolution of Unix and C
#12"In addition to missing lowercase, ASCII 1963 and the Model 33 lacked { } curly braces, | vertical bar, ` backtick, and ~ tilde, and they had ↑ up arrow instead of ^ caret and ← left arrow instead of _ underscore." explains why Smalltalk used the up arrow and left arrow for fairly reasonable punctuation for return and assignment. Up arrow was replaced much later by caret and left arrow was sadly replaced by :=
Some computers going into the 80s, for example the Commodore 8-bit line starting with the PET and going through the Commodore 128, still had ↑ and ← for ^ and _.
Re: Curly braces: An evolution of Unix and C
#13To summarize from the article for { and }:
Modern digraphs:
. This is only one that looks symmetric
Less-modern trigraphs: ??
Unix v4 (in the teletype driver): \( , \)
PDP-11 B: *( , *)
PDP-7 B: $( , $)
In other micro software (Advanced MuMath for the TRS-80), I have seen: > for [ , ]
() for { , }
Back in the 80's, the joke among new learners of C and Unix is that the designers must have had a very bad keyboard where typing each character was painful, because every keyword or command was so short and cryptic. This article suggests a different reason: on their 36-bit Honeywell 6070, "four characters fit into a word", so there was incentive to fit in 1 machine word.It also explains why they used the obscure characters {,},|, and ~ while never using the FAR more common # and @. In the Teletype driver, "#" is clear previous char, and "@" is clear current line. So unavailable for C. I will still curse the C designers to my dying day for picking * as the prefix operator for dereference pointer, when the more logical @ character was SITTING RIGHT THERE! On every keyboard! So now every newbie to C has to stop thinking "multiplication" when they see *.
Re: Curly braces: An evolution of Unix and C
#14Re: Curly braces: An evolution of Unix and C
#15In the words of my combinatorics professor, Dave Bayer: > It is hard to shed prejudices about how code should look, even if learning to see clearly past convention is the only good reason to be a mathematician. I'm already quite sure how I will die: I'll read another article on Hacker News about a new programming language where I see nothing new, and I'll read that they included {}; to make C programmers comfortable.…
{} are important signals that code can and will branch at those points. They’re fundamental to reading.
Also, even in C and C++, they don't indicate branching. You can place a brace block anywhere you can place a normal statement. You might use them in C++ just to delimit the extent of a RAII object. In C89 you might use a block to delay defining a variable until closer to its use, because variables can only be defined at the start of its block (although that no longer applies in C99). Conversely, though it's usually bad practice, you can use if statements and loops with individual statements.
Re: Curly braces: An evolution of Unix and C
#16Earlier quoted context omitted.
{} are important signals that code can and will branch at those points. They’re fundamental to reading.
You can use a different pair of symbols (or pair of words, like in Pascal, or whitespace, like in Python). There's certainly nothing fundamental about them. Also, even in C and C++, they don't indicate branching. You can place a brace block anywhere you can place a normal statement. You might use them in C++ just to delimit the extent of a RAII object. In C89 you might use a block to delay defining a variable until c…
Re: Curly braces: An evolution of Unix and C
#17At least that's how it always in American English, and ASCII. Apparently British English says more than [these] can be "brackets" and were called "angle brackets" in the 1970s, but when did anyone in the computer industry ever start calling anything but {these} braces?
Re: Curly braces: An evolution of Unix and C
#18In the words of my combinatorics professor, Dave Bayer: > It is hard to shed prejudices about how code should look, even if learning to see clearly past convention is the only good reason to be a mathematician. I'm already quite sure how I will die: I'll read another article on Hacker News about a new programming language where I see nothing new, and I'll read that they included {}; to make C programmers comfortable.…
{} are important signals that code can and will branch at those points. They’re fundamental to reading.
Re: Curly braces: An evolution of Unix and C
#19Isn't it odd to read "curly" braces? Every printed dictionary I have, up through the 1990s at least, says that braces are {these}, brackets are [these], and parentheses are (these). Saying "curly brace" is as redundant as saying "round parentheses." Yes, braces are curly, by definition. At least that's how it always in American English, and ASCII. Apparently British English says more than [these] can be "brackets" an…
Re: Curly braces: An evolution of Unix and C
#20Earlier quoted context omitted.
{} are important signals that code can and will branch at those points. They’re fundamental to reading.
You can use a different pair of symbols (or pair of words, like in Pascal, or whitespace, like in Python). There's certainly nothing fundamental about them. Also, even in C and C++, they don't indicate branching. You can place a brace block anywhere you can place a normal statement. You might use them in C++ just to delimit the extent of a RAII object. In C89 you might use a block to delay defining a variable until c…
Yes, but why?