Summary
Paradigm shift is a fundamentally alternate approach to program design. It invites us to think in radically different ways. Sorting, parsing, error handling, and concurrency have very different forms in Scala compared to Java.
Scala provides some stock sorting methods. We took a look at them and then came up against a problem of needless computation when sorting objects. The solution is the Schwartzian transform, a memorization technique. This is a Perl idiom, however, the idea is pretty general. We saw its Scala implementation.
Error handling is usually messy. The scheme of returning error codes always has the risk of us forgetting to check for errors. Exceptions are an improvement. Scala provides a nice solution so the error handling blends ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access