Articles

Tips on Scala, functional programming, Akka, Spache Spark and more

Reading Spark Query Plans

This article is for the Spark programmer who has at least some fundamentals, e.g. how to create a DataFrame and how to do basic operations like selects and joins, but has not dived into how Spark works yet. Perhaps you're interested in boosting the performance out of your Spark jobs. ...

READ MORE

How Things Don't Make Sense - Scala Variables

For a long time in my Scala classes and trainings I used to start the training, obviously, with values and variables. The gripe This is what everyone starts with when learning Scala: val aValue = 2 aValue = 3 // NOPE. can't reassign var...

READ MORE

Higher-Order Functions for OO Programmers

This article is for the programmer who is familiar with Scala concepts and structure, but has the object-oriented programming principles deeply ingrained. This article will not attempt to change them, but rather show you how you can map these principles to the very abstract functional programming...

READ MORE

Controllable Futures

In this article I'm going to address the problem of "deterministic" Futures. You probably know by now that Futures are inherently non-deterministic, in the sense that if you create a Future val myFuture = Future { // you have no future, you are DOOMED! 42 // JK. } you know...

READ MORE

Self-types in Scala, Real Quick

In this article I'm going to address self-types, which are a pretty strange piece of Scala syntax and functionality. Many Scala devs go on writing code for months without any encounter with self-types, then they get baffled by the structure when they need to dig into some library code. ...

READ MORE

Sending HTTP Requests in Scala and Akka in 5 minutes

This article is for the Scala programmer who wants to run one-off HTTP requests quickly. The thinking style assumed is "I don't want to care too much, I'll give you a payload, you just give me a future containing your response". With minimal boilerplate, we'll do exactly that with Akka HTTP in 5...

READ MORE

Why is contravariance so hard?

This article is for the Scala programmer who's either getting started with Scala generics, OR who has been using generics in their basic form, i.e. just attach type arguments, like val list: List[Int] = List(1,2,3) So what's variance? It's that cute little...

READ MORE

8 Scala Pattern Matching Tricks

You can't be a Scala programmer and say you've never used pattern matching. Pattern matching is one of the most powerful Scala features - it allows one to test lots of values and conditions without nested and chained if-else expressions. val aNumber = 44 val ordinal...

READ MORE