Member-only story
The Case Against Curly Braces {} Languages
C, C++, Java, C#, Go, JavaScript and many more languages use curly braces to group statements or declarations. But is this a good choice?

Okay, what the hell. In this story I will argue against one of the most popular syntax conventions by far in the programming world. Programmers love their curly braces. And few new programming languages dare break with this tradition firmly established with the C programming language.
C gained massive popularity early and C++ piggy backed on this popularity. Then came Java which wanted to also piggy back on this success and thus adopted a similar syntax. The huge success of Java caused Microsoft to make their own Java clone, which later became C#. And over at Netscape they where making a LISP or Scheme language, meaning lots of parenthesis, but for marketing reasons it got a last minute remake and got curly braces too.
Bottom line is that curly braces is a bit of an accident of history. I will here try to make the case that using keywords to denote scope like Pascal, Algol, Lua, Ada, Basic and Matlab to name a few examples is better.
In many of these languages begin
end
marks a scope.

Blocks and their indentation level is easier to identify because begin
end
is lager and more visible markers than {
and }
.
But this is not really the main issue. It is that braces must be able to make a case for why they are needed. Why? Because different forms of brackets and braces are of outmost importance in programming languages and we are in limited supply of them. We need them for the following:
- Grouping arithmetic expression. Most use
(
and)
.(2 + x) * 4
- Grouping array elements and perform array access. Most use
[
and]
.x = array[4]
- Specifying type parameter.
vector<int> items.
In the latter case all the curly braces language have been forced to adopt <
and >
despite these brackets being a terrible choice. Why?