The excitement era
This is how I felt for a long time, but I was still excited about the evolution of the web. I wanted to know what was coming next. But what I could find in the news outlet and media wasn't enough for me. Until I discovered the wonders of the open process that happens on the TC39 and WHATWG GitHub org. You can see on your own, what's being proposed and discussed in real-time! Except the people making the decisions are not faceless, untouchable gods like I thought. They are for the most part developers like me and you. And the best of all, comments are open to the public. All you need is a GitHub account and be willing to put your thoughts in a structured manner. As far as my understanding goes, it used to be a bit harder to get involved when things happened through mailing lists, but I never understood those.
Decorators have three primary capabilities:
- They can replace the value that is being decorated with a matching value that has the same semantics. (e.g. a decorator can replace a method with another method, a field with another field, a class with another class, and so on).
- They can provide access to the value that is being decorated via accessor functions which they can then choose to share.
- They can initialize the value that is being decorated, running additional code after the value has been fully defined. In cases where the value is a member of class, then initialization occurs once per instance.
Essentially, decorators can be used to metaprogram and add functionality to a value, without fundamentally changing its external behavior.
You can continue reading it here: https://github.com/tc39/proposal-decorators
The naming problem
As part of the decorators proposal, one feature regarding decorating getters and setters was being called a name I really felt wasn't good (props), so I quickly wanted to propose a new name. Fortunately, I wasn't alone, and a thread had been started already, but no good names were suggested so far in my opinion. And as they say: naming is one of the hardest things in computer science.
So far the initial proposal was calling for “props”, which is a technically correct name, but we use it so much in different contexts that for me it was clear that it was going to cause confusion, not to mention it was certainly going to be hard to google that keyword.
I did my research, a lot of Wikipedia, looking for synonyms, it needed to be something that conveyed what it did but have some connections with other languages since decorators is not a new idea. Then I came up with this comment:
At first, it didn't seem to go anywhere, TC39 was still favorable on the prop keyword.
And then all of the sudden this happened:
And finally this!
I encourage you to read the thread by yourself, I won't go into much detail in this post.
First, I know you might argue that anyone could have suggested the same name, some people even came independently to the same name, and TC39 might even have had the same idea on their own when in a private meeting, I'm not even the first person to call that an accessor, other languages have that, I was just the first person to mention that name on that thread. But that's not the point, the point is: I pointed out why I think it was a better choice, some people disagreed, some people agreed, and that's the beauty of the entire process, even tho I don't have the final say, I'm making myself heard. Even a simple comment is still a valid contribution to the standards. As much as I admire the work TC39 puts towards ECMAScript, they are still people that make mistakes. So if you use the language and care about it, your opinion might change the future.
What was the first open-source project you contributed to?