I'm a stickler for proper punctuation and spelling. Some people roll their eyes at me, but programmers know better.
Part of learning to program is learning that every character counts. A missing symbol, or a character in the wrong place, causes an error. And a bracket is not just a bracket.
I discovered some new terms for symbols this week. That led me down the proverbial rabbit hole, and I'm taking you with me.
A bracket is not just a bracket
Before I learnt to program, I only used the term “bracket”. Now (I thought) I know better:
- Parentheses are round brackets
()
. - Brackets are square brackets
[]
. - Braces are curly brackets
{}
.
Hmmm. According to Wikipedia, a “bracket” in UK English is a round bracket, while in US English it is a square bracket. I didn't know that. It explains why South Africans use “BODMAS”.
But programming tends to use US English rather than UK English. That's why Java and HTML and CSS and JavaScript and Python use "color"
and not "colour"
. Some things we just can't fight.
(What about angle brackets? Programmers use that term for the greater-than and less-than signs. Technically, angle brackets are larger than those signs, which in turn are larger than guillemets. Let's leave it there.)
Pounds, hashes and octothorpes
Years ago I was amused when someone phoned to ask about the “See hashtag” course. If you know the C# language is called “See sharp”, then it is funny.
Actually the #
sign isn't even the same as the musical symbol for the sharp note. Being musically challenged, I didn't know that either. (The musical sharp sign is ♯). So Microsoft should have seen that coming. It could be worse. Someone could ask for “see-pound” or “see-octothorpe” training.
That's your word for the week: the '#' sign is also called an octothorpe.
Let's get silly
Then I read a post that referred to a missing “left banana” in code. Wikipedia doesn't mention it, but it seems some people call parentheses left and right bananas. (Angular refers to the combination [()]
as a banana in a box.)
The hash sign is also called “tic-tac-toe”. Square brackets don't have any interesting names. But curly braces? They are called all sorts of things, including “birdie brackets”, “squirrelly brackets” and “gullwings”. The weirdest name for them is “chicken lips”.
A word about BODMAS
The rules of operator precedence specify that, for example, multiplication happens before addition. I never heard the term “BODMAS” at school, but my Math teacher was Afrikaans. The Afrikaans version is apparently “HVDPM” or “Hendrik Van Der Merwe Plant Mealies”. I don't remember learning that either.
“BODMAS” stands for “Bracket, Of, Division, Multiplication, Addition, and Subtraction”. The term irritates me. “Of”? I've never had a delegate who remembered what that is. And as you now know, a “bracket” may not be a round bracket.
As part of the 4th Industrial Revolution, maybe it's time to adopt the US acronym “PEDMAS”: “Parentheses, Exponents, Division, Multiplication, Addition, and Subtraction”.
Have you get a better acronym or even sillier terms? I'd love to hear your comments.