7 ms·
Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns ar
by rld 12y ago
Not mentioned here: pattern matching. It certainly goes a long way to ensure all cases are being handled, since the compiler lets you know when your patterns are non-exhaustive.
- apoorvai 12y agoIt is. "Yes, you can write more concise code; yes, you have a more advanced type system; yes, you can pattern match. There are hundreds of other reasons that Scala makes a great language. When a language can offer me constructs to write more correct code, I'll always be willing to deal with the learning curve." I think the point was that these are the things that he thinks are of more value to developers than the other good things that Scala offers.
- imanaccount247 12y agoExhaustiveness checking on pattern matches is a big thing that helps with correctness though, so it seems like it should have been in his list.
- rld 12y agoI thought it was worth mentioning as a separate point; just saying "you can pattern match" doesn't say much, when it's actually a key feature to guarantee certain correctness in a program. Pattern matching offers mainly correctness and conciseness, maybe the correctness part should have been emphasized more.