4 ms·
I never understood why JS needs decorators. It has pretty flexible function syntax already, so decorators wouldn't clean nearly as much code up as pipes would.
by k__ 5y ago
I never understood why JS needs decorators. It has pretty flexible function syntax already, so decorators wouldn't clean nearly as much code up as pipes would.
- nobleach 5y agoRight, and it definitely wasn't a comparison between the two proposals. I love OCaml/F#... and Elixir. So the pipes are cool with me. I've never tried the Hack variant however. As far as decorators as a "need". You're right. It's often as easy as `functionName(...args)(target)`. The decorators are definitely convenient for those coming from other languages that have annotations though.