Scala Nuggets: Look Ma! My First DSL

Reading Time: 2 minutes DSL (Domain Specific Language) is a programming language or specification language dedicated to a particular problem domain, problem representation or a particular solution technique. So with a few Scala Nuggets on our way we are ready to write a DSL? Not quite but in this post we would touch upon a critical feature in Scala which makes writing DSL’s easy. Let us look at the Continue Reading

Scala Nuggets: Avoiding the Billion Dollar Mistake of Null

Reading Time: 2 minutes Historically, the use of null has often been referred to as the billion dollar mistake. It has led to more problems than solutions Tony Hoare introduced Null references in ALGOL W back in 1965 “simply because it was so easy to implement”, says Mr. Hoare. He talks about that decision considering it “my billion-dollar mistake”. Let us look at the following code in Java which Continue Reading

Scala Nuggets: The Tasty Tuples

Reading Time: 2 minutes One of the interesting things that Scala has to offer is a concept called Tuples. It is a literal syntax of comma-separated list of items inside parenthesis. Something like (a1, a2, a3). These “groupings” are instantiated as scala.TupleN instances, where the N is the number of items in the tuple. The Scala API defines separate TupleN classes for N between 1 and 22, inclusive. (I Continue Reading