Clojure - Zero to Hero in 20 days

Motivation

It seems that many developers is discovering or need to develop software that runs on multiple cores, and with processor price drop, it became very easy to so.
But dispite the hardware price has dropped dramaticaly and cloud computing made it easy to setup an VM, we, as developers face many challenges on building these types of systems.

Enter Functional Programming

OO programming is in most cases the core of the development for the majority of developers, but dispite the great advantages it brought, sometimes i have side effects that are very difficult to debug.
Functional programming on the other hand, has a very simple approach. Many will say that's the immutability is one of its great advantage (more about this later..)
I had read about functional languages before, Haskell, Earlang, Scala, but I chose Clojure mainly because it's a Lisp (more on that on next post) and is a very beautiful designed language.

1*vY6dXxtVUSRikPrNF8Hjug.png

Tools of trade

After deciding that i'd learn Clojure from the ground up for the next 20 days (Vacation time), i had to choose the tools for the task, so …

Editor:

Emacs seamed to be right choice for many reasons, here some of them.

  1. Emacs is basically a List interpreter with editing capabilities
  2. Hightly customizable

Leinegen:

For automating Clojure projects without setting your hair on fire as its site says, is de facto tool for working with Clojure projects the easiest way possible.

TDD:

For testing, I will using clojure.test and test.check that a very interesting approach called proprety based testing. Let's see.

First snipet is a tracional unit test with just one test. The second one for the other hand, we write properties about your function that should hold true for all inputs and it's very powerful because it can cover much more ground than i'd with unit tests.

(ns noob.core-test
  (:require [clojure.test :refer :all]
            [noob.core :refer :all]))

(deftest a-test
  (testing "FIXME, I fail."
    (is (= 1 0))))

That's it for now. Tomorrow I'll continue diving into the language itself and why it attracted me so much.
Best Regards.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now