Posts

Null is evil

The concept of Null Reference is sometimes referred to as “The Billion Dollar Mistake”. Such pejorative description has been forged by Sir Anthony Hoare, (you can learn more here) probably most widely known for developing Quicksort, but ironically, also the man who first introduced nulls to ALGOL. But why is null A Bad Thing actually? Read more

Recently I was playing around with Rapture, an awesome utility library created by Jon Pretty. One thing that really stuck with me was the concept of modes. Modes are classes that allow us to modify the type returned by a given library call. You probably wonder how we can do that in Scala. I was curious too, so I dig a bit into the code and this is my answer. Read more

A lot of dynamic typed languages has function that catch all messages the target object doesn’t have. It gives these languages a lot of power to write DSL.

Scala 2.9 introduced an experimental option that enables this sort of dynamic handling of accesses to types in ways that would otherwise fail static type checking. It was refined and made non-experimental in 2.10, though it is still controlled through flag which is disabled by default. Read more

Scala is well known as a concise, readable programming language. One of the reasons is that many popular libraries offer their users DSLs to work with. These convenient APIs make creating programs simpler by saving our keystrokes and (most importantly) by improving readability. But it’s not always the case …

Sometimes we have to work with what we were given and sometimes it might be a verbose Java API. I will show you how you can make development easier by abstracting away rough edges of the underlying code. Read more

When considering web application development with Scala you probably think about the Play! framework. It’s a great tool for creating fully fledged enterprise grade applications, but creating something big isn’t always necessary. Sometimes you need something easy that allows for fast time-to-market. I stumbled into this problem some time ago when doing prototyping and Skinny saved me a lot of work.

This post is a quick introduction to the framework, hopefully helping you with getting started. As an example I’ll show you how to put together an app that gathers poll results. Read more

Hi. Specs2 is one of the most popular Scala libraries for testing, but definitely not a simple one. That’s why I’ve decided to create a blog post with a few tricks on how to make working with Specs2 much easier. The examples are 100% artificial, but their purpose is only to demonstrate the capabilities of Specs2. Read more

Adventure begins

Recently me and a few of my colleagues from ScalaC worked on an integration project which aim was to provide an interface between a machine learning engine and its clients via a Spray-based HTTP server and (internally) a persistence layer. As our work meant to be just a part of a larger system we did not have much say in how the data should be persisted or where – MySQL in this case. It was however up to us to decide how we would access the data.

Having had a lot of positive experience with Typesafe’s technologies we immediately turned to Slick. It’s also worth mentioning that one of the expectations was to achieve a reasonable request rate with minimal scaling as our client was a startup with limited funds. Read more

Akka Streams is an exciting new technology from Typesafe that is an implementation of the Reactive Streams specification. To this point two other implementations have been declared (from the Reactor team and Netflix’s RxJava team) but only the Typesafe’s implementation is mature enough to do some experimenting with it. This blog covers the 0.3 version of Akka Streams. You can find the API here

RabbitMQ is a messaging broker implementing AMQP 0-9-1 protocol. It’s known for its reliability, speed and simplicity in everyday use.

These two technologies seem like a perfect fit, so in this post I’m going to explore some basic integration possibilities and example usage. Read more