Back in 2016, Li Haoyi put together this nice article titled, Benchmarking Scala Collections.
Tutorials about the Scala programming language.
I was working on some new code for my functional programming in Scala book today. At one point I thought everything looked okay, so I decided to generate some Scaladoc to see what certain things looked like. Admittedly I’m a bit tired today, but when I saw that Scaladoc I thought, “Good grief, Al, what sort of ugly API have you created?”
For some reason, seeing the Scaladoc helped me easily see the errors of my way. I’m not sure that I’ll ever be promoting a “Scaladoc-driven API design” process, but seeing the Scaladoc generated from my code sure helped today.
~ a note from August 30, 2017
I normally don’t like to have sales on my books, but the short story is that the PDF version of Functional Programming, Simplified is currently on sale for $15.
Scala problem: You want to be able to read configuration files that are written in the Lightbend “Config” file format.Back to top
Lightbend — initially named Typesafe — created a configuration file format named HOCON, which stands for, “Human-Optimized Config Object Notation.” As an example, a small HOCON configuration file looks like this:
As a brief note to self, if you ever want to write some code using Scala that recursively descends through a directory tree, here’s a solution that uses the Java
Files.walkFileTree method. First, here’s a skeleton class for the
SimpleFileVisitor part of the solution:
Create a Dotty project:
sbt new lampepfl/dotty.g8
Launch VS Code inside that project directory, with Dotty support:
Start SBT as usual:
Those notes are just a reminder for myself, but hopefully they’ll also help others work with Dotty, SBT, and VS Code.
If Functional Programming, Simplified seems large, a) I intentionally wrote it in a simple, leisurely style, and b) it’s a lot easier than reading hundreds of blog posts and all of those books on the right (although a few of those books are really good).
November 29, 2019: A few days ago I made the PDF version of “Hello, Scala” free, and today I made the paperback version of “Hello, Scala” available again, and reduced it’s price from $20 to just $10. Click the image below to buy the book on Amazon.
As I’ve noted before, the contents of this book are being updated and improved, and in the future it will be available as Scala Book. The HTML version of those contents are currently available on the docs.scala-lang.org site.
November 26, 2019: The PDF version of my book “Hello, Scala” is now free, and you can download it by clicking on the image below.
Future “updated and improved” versions of the book are being released as Scala Book. Currently an HTML version of the book is available here on the scala-lang.org website, and we’ll have PDF, MOBI, and ePub versions of that available once the creation process is automated and a few other issues are resolved.
But for now, click on the image below if you’d like to download the PDF of Hello, Scala for free:
As a brief note today, if you need to read a binary file with Scala, here’s an approach I just tested and used. It uses the Java