The post is a mix of Java, Scala and some fantasy language. I use the code examples to explain my points not as actual working code
I really like interfaces. I wrote about them here. They feel clean to me. They abstract ideas and minimize the contract between classes. I encourage developers to develop against interfaces.
Continue reading How to Improve Interfaces
Errors are huge in development. As is error handling. Sadly not a lot is written about best practices in error handling. Most languages favor one way to handle errors and apply that to all cases. Developers tend to ignore errors or take the mechanism that is in hand. This article goes a little deeper into ways to handle errors and I share some thoughts on what error cases might be best handled by what methods. Continue reading Some Thoughts on Error Handling
Today it’s clear that representing optional values with Null was not the best idea. Several modern languages model this problem with explicit nullable types or Option Monad (after the Haskell Maybe Monad). As Option in Scala has influenced my programming style heavily over the last years, I wanted to compare how other languages deal with this. I did not include Groovy although it was one of the first (the first?) JVM language to safely dereference null values because I currently have no interest in Groovy.
Continue reading Comparing Optionals and Null in Swift, Scala, Ceylon and Kotlin