Re:TC39, ECMAScript, and the Future of JavaScript
by mmargerum on Tuesday June 27, 2017 @07:25AM
(#14644319)
When marshaling classes in and out of xml/json decarators can be added to properties to change the name of the equivalent Json field value as well as indicating if it's optional or not. Orms use decators to map object to relational tables the may have different field names, expressing key values, etc
[ Parent
| on HN ]
Re:TC39, ECMAScript, and the Future of JavaScript
by abritinthebay on Tuesday June 27, 2017 @11:37AM
(#14646385)
None of that sounds particularly hard, complex, or tricky without decorators though.
Like, I get they can be used for stuff but why are they a better option?
So far - based on the responses here - it appears to be syntax for syntax sake and no practical benefit.
Re:TC39, ECMAScript, and the Future of JavaScript
by mmargerum on Friday June 30, 2017 @10:38AM
(#14671009)
It's just sugar but it's less code and I find it easy to read at least in go.
Re:TC39, ECMAScript, and the Future of JavaScript
by abritinthebay on Thursday July 06, 2017 @03:51PM
(#14713334)
It’s not really less code though. It’s about the same but with an syntax that obfuscates where the logic happens.
Terse at the usage point yes, but it swaps clarity for brevity. A sometimes useful trade off to be sure but... not sure I’ve seen any demonstration of benefits here.