With the Dotty compiler you can convert Scala 2 code to the new Scala 3 syntax, and with the Dotty 0.20.0-RC1 release on November 4, 2019, I thought I’d see how some of the conversions work. Almost all of the changes shown below have to do with the elimination of curly braces and the use of “significant indentation” syntax, but in one example I also show the
I originally wrote a long introduction to this article about Scala Options, but I decided to keep that introduction for a future second article in this series. For this article I’ll just say:
- idiomatic Scala code involves never using null values
- because you never use nulls, it’s important for you to become an expert at using
- initially you may want to use match expressions to handle
- as you become more proficient with Scala and Options, you’ll find that match expressions tend to be verbose
- becoming proficient with higher-order functions (HOFs) like
fold, and many others are the cure for that verbosity
I worked on some tools and processes today, so sometime soon we should have PDF, EPUB, and MOBI versions of “Scala Book” available.
One small step for me, and I don’t know if it will help mankind at all. But Hello, Scala is now called Scala Book, and you can find it here on scala-lang.org.
Here’s an example of Union Types in Scala 3 (Dotty). This image comes from this Martin Odersky video.
I recently had a discussion with two people I’m working on a book with, where they are essentially very active reviewers. I like to write with enthusiasm, so I made a particular statement in the book. One person said they thought it was motivating — which was my intent — but the other person said it made them wary. I thought it was fascinating to get such different perspectives.
Here’s some source code that demonstrates a quiet, concise, and attractive new programming language I’d enjoy using:
I recently created a command I named
ffx that lets you search your filesystem for files that contain multiple strings or regular expressions. This post describes and demonstrates its capabilities. (There’s a little video down below if you want to see how it works before reading about it.)