Clean slate looks significantly better on initial read. Did I miss mention of why `var ids = []` inside of class body wouldn't work in clean slate as initializers? Have there been any discussions of variable access of private state? (Like [] notation but for private state only)
-
-
-
Clean slate rejects initializers (and therefore fields). I think I left links to the rationale; if not, follow to the repo and search the issue tracker.
-
What do you think about `var` as the way to declare private instance variables?
-
It's less offensive than # on the surface, but I wonder if it might be confusing since it doesn't behave like folks have learned `var` does (access and assignment without `this->`). If `hidden concatIds(){}`, why not also `hidden ids;` for consistency?
-
-
I would object to `this.
@foo` also. I think enough languages use # for comments that it doesn't read naturally. I imagine a language that used // as an operator would have the same trouble. But `this.#something` is the worst part for me -
Can you imagine getting used to it as analogous to leading `_`?
-
- 6 more replies
New conversation -
-
-
I think 'var' is very confusing there, also having a different way of handling instance variables (this->prop) is unnecessary. The hash for private fields is a bit 'ugly' (no code shaming) i wish it was an underscore.
-
Do you think you could get used to #? The problem with `_` is it's already valid in public properties.
-
Or a private keyword and no special syntax?
-
https://github.com/tc39/proposal-class-fields/blob/master/PRIVATE_SYNTAX_FAQ.md#why-not-do-a-runtime-check-on-the-type-of-the-receiver-to-determine-whether-to-access-the-private-or-public-field-named-x … Read the whole thing :)
@littledan and others did a great job writing this all down. -
Hash it is!
-
Not to stir a hornet's nest, but it was almost `@` (from ruby and a little bit coffeescript), but decorators got there first in adoption in transpilers.
-
I think @ is too confusing for private fields, it's kind of a standard to have `
@decorator`. Same rationale behind the use of `var`. It's better to learn something new than giving new meanings to something old. And # is better than % -
Honestly, yep!
End of conversation
New conversation -
-
-
Out of interest, why is there seemingly so much resistance to keywords like private or public?
-
Because they’re taken by TS
-
I disagree strongly with this. If we tried, I think we could make it work. I plan to propose `private
#foo` declarations at the next meeting :) - 1 more reply
New conversation -
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.
