How do you feel about braces and semicolons?

17cupsofcoffee

Joe Clay

Posted on March 26, 2018

How do you feel about braces and semicolons?

I'm (slowly) working my way through Crafting Interpreters, and trying to put together a design for my little interpreted language. Thinking about the syntax has got me curious - do you prefer for a language to have:

  1. Braces and semicolons (C, JavaScript, Rust)
  2. Braces and no semicolons (Go, Wren)
  3. Semicolons and no braces (I'm not actually sure anyone does this?)
  4. No braces and no semicolons, with significant whitespace (Python)
  5. No braces and no semicolons, with no significant whitespace (Lua)
  6. Some other wacky design I've not thought of...

Personally, I tend to prefer the explicitness of option 1, but at the same time I don't really like that {} has a double meaning (is it a scope, or is it an object literal?). How about everyone else?

💖 💪 🙅 🚩
17cupsofcoffee
Joe Clay

Posted on March 26, 2018

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related