Understanding Type classes in Scala : extending types you don’t own

Type classes are a very common pattern in Scala. My goal in this post is to demystify what they are, how they are useful, and how they are supposed to evolve in the next big iteration of Scala, currently known as Dotty. Why do we need type classes ? Type classes are a programming technique that allows you to define common behavior for multiple types. Type classes act as a kind of interface, providing a common way of interacting with multiple types, while each of those type have different concrete implementation for this interface.
Read more →

Why I’ve switched to emacs and why you might want to switch too

Today, I want to talk about the most important of my daily workflow : my text editor. I’ve been programming since I was a teenager and I’ve used perhaps a dozen of text editors, hoping to find the One, a text editor that would suit all my needs and would follow me for the rest of my career as a software developer. And I thinkg I might have found it.
Read more →

Managing side effects and building scalable React apps with Redux Saga

Let me get this out of the way: side effects are evil. Our job as developers is to build abstractions that solve problems. We build independent, confined little worlds of abstractions that we can control, understand and predict. But at the end of the day, for most jobs, we need some connection to the chaos of the outside world. That’s where the trouble comes in. Side effects, being this necessary connection to the outside world, are unreliable, hard to test and sometimes hacky.
Read more →

Performance of recursive functions (and when not to use them)

As powerful and appealing a tool is, it’s always better to know a little about the cost of using it before doing so. Recursion is no exception. Depending on the programming language you’re using and the problem you’re trying to solve, recursion might not be most efficient way to go. I’ll try to explain why in this article. We will cover tail call elimination, memoized functions, as well as an example of inefficcient recursive function.
Read more →

Understanding recursion

Recursion is an essential part of the functional programming tool set. It allows breaking down complex problems into a possibly indeterminate number of subproblems. It is often used as a functional alternative to loops in the imperative world, because it allows, among many other things, to loop over elements of a data structure, while preserving the immutability of your state. This post is the first one of two posts about recursion.
Read more →