Ted Neward has a great post analyzing new C# 3.0 features.
Ted refers to the language enhancements as mostly “syntactic sugar”. In other words - the syntax additions don’t change the expressiveness of C#, but merely add conveniences and shortcuts. We write less code while the C# compiler generates more IL behind the scenes.
Over the years I’ve been puzzled by the term ‘syntactic sugar’. People generally use the term in a derogatory sense, as in: “C++? Pffft. That’s just C with some syntactic sugar”.
Isn’t every language just syntactic sugar when compared to, say, CPU opcodes?
Comments
I know my understanding of the definition of Landin's term "syntactic sugar" and it is essentially this:
http://en.wikipedia.org/wiki/Syntactic_sugar
I find wikipedia's definition practical, but not rigorous and I am unaware of Landin providing rigor.
I just commented on Ted's Blog to see if he could clarify this. He's not rigorous in his general usage of the terms "feature" and "sugar", but then provides distinctions without definitions.
But who am I to judge the content of a verbose post (the best kind in my opinion) that clearly attempts to explain features of the upcoming C# in a meaningful and useful way. And I want to be clear here that I'm not trying to be a gossip or throw rocks or incite a riot, etc. by commenting here. I tend to agree with your usage of "derogatory".
Thanks for the link.
---O
I haven't checked whether Ted has been consistent in distinguishing between the two, nor am I going to as I'm just happy to have read such an interesting and informative post.
My post was two different thoughts:
1) Ted's article is good.
2) Is syntax sugar really a "bad thing"? It's often stated in a way to trivialize a feature.
I understand in Ted's case he'd like to see more sugar in Java - so sugar must have some value.