|
|
|
|
|
by tormeh
2260 days ago
|
|
I've done the same by being lazy, mainly treating it as a better Java and only learning new stuff when necessary or obviously beneficial. I want to write good programs, not fancy code. My advice: - Options, immutability, pattern matching, and list comprehensions are all awesome and better than the default Javaesque way - Scala concurrency abstractions all better than Java, but concurrency is still hard. Proceed with caution -- Except parallel collections. Use those liberally - No Scalaz or any other FP-crusader stuff ever - Macros and implicits should be rejected by default in code review. Amazing justifications required - Enforce coding rules with linters. This applies for any language, but especially important for dynamic and non-straightjacket languages |
|
So what happens when you are dealing with multiple option types, like you two optional ints you need to add together? Or you have an optional field in an optional object? This happens all the time in code that heavily uses Option types.
So do you match on every one, and nest match expressions inside match expressions inside match expressions? That can get very, very messy and even confusing.