DEV Community

loading...

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

Collapse
moopet profile image
Ben Sinclair • Edited

This entire post is Semantic Seasoning, which means it's about changing the way things look without changing their functionality, and it's really salty.

I think the phrase "semantic sugar" exists to let use know that something only exists for that reason. If someone introduces a way of abbreviating the language without changing its functionality, that's SS. It's bad because it's not backwards-compatible and doesn't add anything new.

Your example of += is semantic sugar, but because it's been in languages for donkeys' years it's ok. If you were to take a language without that symbol (Python?) then introduced a mod to allow it, that'd make a lot of people happy. But it would require everyone else to use the same mod (whether it be a library or a change to the interpreter) and that mod would be seen as unnecessary by a lot of people.

I think that's the difference. SS is a problem when it makes unnecessary things necessary.