Articles by Mateus Pereira

Unit testing in Elixir

It's been a few months now that we've been toying with Elixir here at OmbuLabs. Particularly with Phoenix. However, I like to toy a bit with the language without the added complexity of a framework on it, in order to better understand it, how it works and how things are done.

It took me a while, but as I read through "Programming Phoenix", I had the idea to implement a "simple" calculator program in Elixir. The reasons were quite simple:

  • I wanted to better grasp unit testing with ExUnit, and a calculator has very clear specifications, making it the ideal candidate.
  • I also wanted to put a little twist to things and while math has very clear specs, it can have some very complex operations, so I decided to make my calculator do derivations.

For those of you that aren't versed in calculus, don't worry, I'll give just what you need to know in order to understand what I'm doing, but trust me, you won't need to really understand calculus to understand the code.

Read more »

Design Patterns in Ruby - Intro

The title says it all, but how does one actually implement object oriented design patterns in Ruby? If you're like me and always struggled with putting what you read about programming into an actual implementation and the examples in the book or around the internet weren't enough to quell your doubts, read on.

Read more »