Clojure - Zero to Hero in 20 days

in #clojure7 years ago

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.

Sort:  

Thanks for the upvote @zsh.

Congratulations @marcpires! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Comment

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

How are you getting on? I'm not really a programmer. I'm a musician, who realized being able to build his tools may be of value, so I started playing with Linux, coding and related tools a couple of years back. Clojure is really appealing to me! In hindsight, probably a bad choice for a newbie... due to Java knowledge requirements, but I've learned a lot. Emacs w/ CIDER rules! :) You should also give boot a try, over Leiningen.

Blockchain tech, and the word 'immutable' keep reminding me of Clojure and I wonder why this and other functional languages aren't becoming more popular. Maybe they are, but my brief search doesn't indicate so! ;)

Congratulations @marcpires! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @marcpires! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.19
TRX 0.18
JST 0.035
BTC 90742.62
ETH 3165.07
USDT 1.00
SBD 2.77