It is literally inconceivable to me that anyone remotely familiar w/ the current JS ecosystem could conclude decorators are not "well motivated" I can't help but wonder if some people have idiosyncratic opinions against this feature, and are manufacturing opposition therefrom.
-
-
What are the arguments against it? Why isn't it "well motivated"?
2 replies 1 retweet 0 likes -
Replying to @satya164 @AdamRackis and
The only thing I can think of: Decorators make code nearly impossible to statically analyze and optimize, where attributes (like you might find in C#) do not.
3 replies 1 retweet 7 likes -
...but AFAIK, the TC39 doesn't really consider how statically analyzable a JavaScript feature is to be an important enough point to block a proposal.
1 reply 0 retweets 2 likes -
FWIW I think decorators are a fun, powerful addition. But are perhaps, like classes, a little overused in apps. But that's a pretty subjective opinion and I know it.
1 reply 0 retweets 4 likes -
Their main use case is for enabling a handful of high leverage framework features that used to be possible when classes were built using object literals which contained embedded function expressions.
1 reply 0 retweets 1 like -
You'd expect this use case to be used a lot in absolute numbers, because those decorators are the "class" and "function" of the framework in question. It might be iffy if a single app uses 100 different decorators, or is making a lot of its own.
1 reply 0 retweets 0 likes -
iow
@connect is really just "custom syntax" for the Redux dialect of JS, to a first approximation. A handful of those extensions are very powerful. Dozens and you should probably be using your own language.1 reply 0 retweets 0 likes -
Yes, exactly. High-level framework features applied to a class, spitting out a new class wrapping the old, adding new stuff. Other main use case ime is for ergonomic mixins const validated = Class => class extends Class { isValid = true; validate() { etc }
1 reply 0 retweets 2 likes -
And maybe a cowpath for real syntax someday!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
