A summary of feedback regarding the # sigil prefix · Issue #100 · tc39/proposal-class-fields (original) (raw)
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
Description
Issue/comment | 👍 | 👎 | 🎉 | ❤️ |
---|---|---|---|---|
Stop this proposal | 196 | 31 | 20 | 45 |
Why not use the "private" keyword, like Java or C#? | 132 | 7 | 12 | 5 |
Why not use the "private" keyword, like Java or C#? 💬 | 144 | 0 | 16 | 9 |
Why not use the "private" keyword, like Java or C#? 💬 | 51 | 0 | 0 | 0 |
Private Properties Syntax | 33 | 4 | 0 | 0 |
Yet another approach to a more JS-like syntax | 32 | 0 | 0 | 41 |
New, more JS-like syntax | 32 | 4 | 0 | 0 |
Please do not use "#" | 32 | 0 | 1 | 1 |
Proposal: keyword to replace `#` sigil | 18 | 0 | 0 | 1 |
Why not use private keyword instead of #? | 16 | 0 | 0 | 1 |
Explore a more JS-like syntax | 7 | 0 | 0 | 0 |
The '#' looks awful, please change it | 9 | 4 | 0 | 0 |
can we just use private keyword? | 2 | 0 | 0 | 0 |
Do we still have a chance to stop private fields (with #)? | 3 | 3 | 1 | 1 |
[Private] yet another alternative to `#`-based syntax | 3 | 0 | 0 | 0 |
and yet another suggestion for "private but not closure" | 0 | 0 | 0 | 0 |
Why don't use `private` instead of `#`? | 0 | 3 | 0 | 0 |
Why "private" and "protected" future reserved keywords are not used? | 0 | 0 | 0 | 0 |
Other feedback:
- http://2ality.com/2017/07/class-fields.html
- From the comments: "I'd rather shoot myself in the face than use hashtags for private fields."
* 33 upvotes (comments closed)
- From the comments: "I'd rather shoot myself in the face than use hashtags for private fields."
- ES Next Features That'll Make You Dance
- "And beware, you may have an adverse reaction ..."
- "Oh, I heard somebody groan!"
- Some comments:
* > #method() is gross, at least I use typescript and don't have to look at it. 👍30
* > So ES is becoming the new PHP "ugly-wise"? So glad i use typescript. They should have delayed that private method feature some more and thought some more to really avoid having that absolutely terrible, horrible looking # syntax. Ew.. In code everything is possible. EVERYTHING (if your not into computer science). If they have to break backward compat then so be it. So very bad.
* > I am excited about getting new features and I like to see things continuing to grow, I am not liking that private property syntax in the function, it looks like a comment and makes me shudder... everyone should be aware of this "fact" - every time someone gets confused and thinks the # symbol is actually a comment when JavaScript should have used the word private to declare a private entity, a bag of kittens gets thrown into a wood chipper, very sad.
* > Fix the private keyword issue please! The proposed syntax is not only inconsistent with the static declaration but also looks like a comment!
The TypeScript team are not fond of the syntax either.
My suggestion to rename the proposal: tc39/proposal-private-fields#72
(the idea is mainly about making it a lower-level feature, and making room for a cleaner syntax at a later date)
@littledan @bakkot @ljharb – I apologize in advance, as I know that you must be thinking "Oh g*d, not again!", but I just wanted to put this all in one place, and allow the community to share their opinion in the form of reactions. It would be great if you could keep this open for a while (30 days?), or perhaps even indefinitely to prevent other users from submitting even more issues on the same topic.
To the non-committee members reading this: These proposals are now at stage 3, so it's unlikely that a syntax change will occur, but please feel free to up-vote this issue if you feel that the sigil (#
) prefix is not a good fit for the language, or down-vote the issue if you believe that it's perfectly acceptable.