You Really Should Know A Bit Of Clojure – Ben Orenstein

Ben Orenstein has been knee deep in object oriented programming for years, dealing with it’s limitations, yet more recently has been enjoying the benefits of functional programming with Clojure. Here, he talks about why everyone should know a bit of Clojure and the benefits it brings to his Ruby code.

Orenstein runs through immutable data structures (go to 3:55) and how they prevent a class of bugs in Ruby where an object is passed into a method and is somewhere along the line passed to something that mutated it, a bug which can easily take a day to track down.

I’m finding that the code I am writing is really nice, it’s nice in Clojure and it’s also affecting my Ruby in a positive way, I am now thinking about – how little can I get away with mutating and when I mutate can I control it in the most extreme way possible to the biggest extent I can?

He goes on to demonstrate running functions on values in boxes to change values using swap showing how immutable data stays the same (go to 12:10) saying that using this in functional programming can improve skills in OOP and how he has now stopped writing things in Ruby that mutates things as much as possible.

The end of the talk goes through Clojure’s macro system (go to 18:50) which allows the compiler to be extended by user code, using a wall as an analogy to accessible parts of the language against Ruby and because Clojure compiles into JVM byte code all the features that Clojure offers are able to be compiled down into JavaScript and run in the browser (go to 23:30).

Comments

comments

Ben Orenstein has been knee deep in object oriented programming for years, dealing with it's limitations, yet more recently has been enjoying the benefits of functional programming with Clojure. Here, he talks about why everyone should know a bit of Clojure and the benefits it brings to his Ruby code. Orenstein runs through immutable data structures (go to 3:55) and how they prevent a class of bugs in Ruby where an object is passed into a method and is somewhere along the line passed to something that mutated it, a bug which can easily take a day to track down. I'm…

Review Overview

I've gotta have a look around Clojure
Ben Orenstein rocks

User Rating: Be the first one !
89

About Gary Donovan

Machine Learning and Data Science blogger, hacker, consultant living in Melbourne, Australia. Passionate about the people and communities that drive forward the evolution of technology.

One comment

  1. I don’t care about this, now i’m making around 3500£ a month.

    There is tricky method i found on the web. If you want to learn it too, simply type in google: Irahsik’s betting system

Show Buttons
Share On Facebook
Share On Twitter
Share On Linkedin
Share On Pinterest
Share On Stumbleupon
Contact us
Hide Buttons