3 ms·
Javascript is such a mess, this proposal looks really bad, and the guys discussing it are saying things like: "we should make sure that this doesn't look like a
by d--b 9y ago
Javascript is such a mess, this proposal looks really bad, and the guys discussing it are saying things like: "we should make sure that this doesn't look like anything else, so that people who learn the language don't confuse match and switch..."
There is also a lot of "we shouldn't break that" messages, and people reply with "oh we already screwed that up here and there, so it's fine"...
- 11235813213455 9y agoahh, the classic JS bashing from a dotnet or Java or PHP or Ruby or Python dev, or just by ignorance
- ealhad 9y agoIt looks pretty much exactly like the Rust match, though. https://doc.rust-lang.org/stable/book/second-edition/ch06-02-match.html https://doc.rust-lang.org/stable/book/second-edition/ch06-02...
- Dibes 9y agoas someone who only has a little experience with pattern matching, how does this look bad? The syntax looks good enough to me that I could and would want to use it.
- ealhad 9y ago“looking bad” is a really subjective thing. Here is the syntax for different languages: - Rust https://doc.rust-lang.org/stable/book/second-edition/ch06-02-match.html https://doc.rust-lang.org/stable/book/second-edition/ch06-02... - Haskell http://learnyouahaskell.com/syntax-in-functions http://learnyouahaskell.com/syntax-in-functions - Scala https://docs.scala-lang.org/tour/pattern-matching.html https://docs.scala-lang.org/tour/pattern-matching.html
- ryanmarsh 9y agoI don't understand what all the fuss is about. Just looking at the syntax examples given, it looks really nice and I would jump at the opportunity to use it.