DEV Community

Discussion on: Sh*tpost: can we stop saying "syntactic sugar"?

Collapse
 
jenc profile image
Jen Chan

Well I guess coffeescript is complete syntax caramel then!

That is a really clear example, thanks!

Collapse
 
eljayadobe profile image
Eljay-Adobe

lol "complete syntax caramel"... I love it! I'm using that!

I've also used the term "syntactic saccharine" to describe bad sugar. Causes cancer of the semicolon.

I like how CoffeeScript turns this

x?.y?.z = 3

into this

if (typeof x !== "undefined" && x !== null) {
  if ((ref = x.y) != null) {
    ref.z = 3;
  }
}

Short, sweet, and succinct. Now that is a delicious syntactic caramel!

Thread Thread
 
antonfrattaroli profile image
Anton Frattaroli

Those are great. Included with C# 6, probably copied from coffeescript.