Playing around with some adjacent sketches re: class syntax: https://gist.github.com/wycats/b2030bb205add6861ba7dc2279bcf625 … These guys are totally sketches, not proposals! But maybe interesting.
-
-
-
Replying to @jacobrothstein
I find it interesting that people with a PHP background seem to hate -> with a passion. Trying to figure out how I should weigh this.
1 reply 0 retweets 0 likes -
Replying to @wycats
I can’t speak to that. The arrow looks like C++ to me, for better or worse
I can imagine it being confusing to a beginner that x=>y is a function but x->y is private access (if x is the same class as this). Not as bad as var, though1 reply 0 retweets 0 likes -
Replying to @jacobrothstein
I'm also trying to work out whether people would expect -> to work with public stuff: class Person { private name; constructor(age) { this.age = age; } toString() { // would you write this->age? return `${this->name} aged ${this.age}` } }
1 reply 0 retweets 0 likes -
Replying to @wycats @jacobrothstein
It's a little hard to tell without being in the flow and churning out code. It seems much less likely with `.#`
1 reply 0 retweets 0 likes -
Replying to @wycats
not sure why that would be any more or less likely to happen with either. i assume accessing an undeclared private throws, so the bigger risk is going in the other direction, since normal access would silently return undefined
1 reply 0 retweets 0 likes -
Replying to @jacobrothstein
I could see getting into a mental model where I use private a lot and -> is just how I access stuff. I agree the other direction is pretty bad.
1 reply 0 retweets 0 likes -
Replying to @wycats @jacobrothstein
Consider this TS'ish snippet: class Person { private name; public age; toString() { // private and public look a lot alike, the only diff is the sigil } }
2 replies 0 retweets 0 likes
I guess I'm feeling like the -> sigil still treats the rhs like an unadorned name, which isn't quite enough. But this is just a feeling that came from writing a bunch of examples real quick. I can't be sure.
-
-
Replying to @wycats @jacobrothstein
I’d like to type “this.” and see autocomplete for both private and public methods / properties. It seems like “this->” makes me choose too soon that I want something private.
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
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.
