Scala · Tutorial

Traits are better than Legos!

One of the most powerful (and cool) features in Scala is that you can use traits as stackable modifications. Let’s see how it works with a simple tutorial 🙂 Our goal is to create a list of ordered colours, let’s call it ColourMixer. First we create a class to represent what a basic (empty) colour mixer is: Let's create our Legos… Continue reading Traits are better than Legos!