top | item 19283238

TypeScript: Vote for Experimental Support of Optional Chaining

15 points| IvanGoncharov | 7 years ago |github.com

13 comments

order
[+] fixermark|7 years ago|reply
Clarification: TS team is aware of this feature desire and has a plan to support it (their plan is hinged on an existing standard that is still being locked down for JS; details in https://github.com/Microsoft/TypeScript/issues/16).

No real benefit in voting on it now, other than to express your added desire for a thing the TS team already knows people want.

[+] evmar|7 years ago|reply
Language design should not be determined by "votes".
[+] fixermark|7 years ago|reply
Wellllllll....

Languages are used by people. So it depends, a lot, on the goals of the stewards of a language. Votes can be a useful signal for whether or not people are going to care about your language enough to adopt it.

... but it's absolutely true that voters can vote for the moon and then skip off blissfully, never having to worry about how you implement the Apollo project.

[+] nojvek|7 years ago|reply
Language design priorities should definitely decided based on votes.
[+] swsieber|7 years ago|reply
Correct.

It is valuable feedback though.

[+] tlackemann|7 years ago|reply
It's been years since this proposal and everyone keeps arguing over semantics yet I don't see any semantics being changed. So what's the holdup? I understand constraints and external factors/dependencies but this seems like such a trivial change that it boggles me we don't have this as a standard feature yet.
[+] Waterluvian|7 years ago|reply
Interesting. I think I saw this in Swift? Or c#? I guess in Python this is where EAFP comes in.

I definitely hate chains of guards to get at a nested property.

[+] kreetx|7 years ago|reply
In haskell the lens library does this -- it's a useful feature to have.
[+] LocalPCGuy|7 years ago|reply
Quite a few language have this feature, and it is a Stage 1 proposal to become a part of the JS spec