The Blackstag BlogLogin
 Feeds RSS About  Categories: Everything  Hardware  Software  Programming  Finance  
Guide to Programming in Clojure for Beginners
Posted Jun 27, 2011 [category: Programming tag: Clojure]  Leave-Comment  View-Comments  

A long time ago I set out to start a blog and at some point, thereafter, I decided that building a custom blogging platform was a better idea than choosing from one of the many off-the-shelf solutions. I'm not going to go into the many reasons why I made this decision, but I will say that one of the reasons was to learn a new programming language, which has led me to where I am today - knee deep writing code in Clojure and writing blog posts about a programming language I'm happy to have discovered.

So Why Clojure?

Originally, I picked Clojure for its speed, access to Java libraries, effectiveness in parallel computing, concurrency management capabilities, functional language paradigm and powerful code generating code macro system. But as powerful and impressive as these features are, none of them are really the reasons why I am still using the language. Instead, after several months of work, I have discovered what I like the most about Clojure is that it brings together the best of what many languages have to offer while not forcing it all upon me and, in doing so, has provided a good balance between power and flexibility. For example I have found that I can utilize pretty much any Java library, yet I don't have to spend much time interfacing with Java. I can implement code or features using functional abstractions, but I can also choose to incorporate object oriented abstractions. I can choose to declare data types in select cases where it might be needed or I can allow Clojure to choose for me, eliminating some boiler plate code that would otherwise be distracting. While the list of examples showing both Clojure's power and flexibility can go on and on, ultimately what's really important to me is that much of the code complexity I normally associate with programming can be abstracted further away while still having access to mega powerful features. This, in turn, has allowed me to spend more time focused on my business ideas and less time figuring out how to code them. With Clojure I accomplish more and have found a greater sense of happiness with the work I am doing.

Scope of Content

Clojure is a rich language, loaded with features. So much so, that one could literally find themselves writing a book, even when only intending to write a blog post! So while reading this guide, it's best not to expect coverage on many of the super cool features that Clojure has to offer as I've only been able to give consideration to what I believe is necessary for a beginner to get started.

Like This Post!
Guide to Programming in Clojure: Chapter Links
Posted on Jun 27, 2011 5:01 PM  [Likes: 23 comments: 15]
Posted on Jun 27, 2011 5:01 PM  [Likes: 18 comments: 1]
Posted on Jun 27, 2011 5:01 PM  [Likes: 23 comments: 1]
Posted on Jun 27, 2011 5:01 PM  [Likes: 25 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 21 comments: 4]
Posted on Jun 27, 2011 5:01 PM  [Likes: 25 comments: 1]
Posted on Jun 27, 2011 5:01 PM  [Likes: 17 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 19 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 11 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 13 comments: 0]
Posted on Jun 27, 2011 5:01 PM  [Likes: 8 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 12 comments: 0]
Posted on Jun 27, 2011 5:01 PM  [Likes: 12 comments: 0]
Posted on Jun 27, 2011 5:01 PM  [Likes: 17 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 17 comments: 1]
Posted on Jun 27, 2011 5:01 PM  [Likes: 13 comments: 10]
Posted on Jun 27, 2011 5:01 PM  [Likes: 15 comments: 2]
Posted on Jun 27, 2011 5:01 PM  [Likes: 9 comments: 3]
Comments
 Comment posted on Jun 29, 2011 5:37 AM by  octopusgrabbus
Thanks for putting in this much effort. For non-lisp programmers, there is a lot -- at least for me -- comfort barriers to hurdle. It all makes sense, but getting syntax help is difficult.
 Comment posted on Jun 29, 2011 12:21 PM by  Bart J
Thank you! Thank you!
Your writing is crystal clear, can you please write a tutorial on Clojure macros ?
  Reply posted on Jun 29, 2011 1:20 PM by  Tim Robinson

Thanks. I am glad to see the posts are helping. I would love to write more about Clojure, but for now I am going to take a little break to focus on a few other posts I've been planning to write for quite some time. That said, macros have now made it to the top of my Clojure related items to write about!

 Comment posted on Jun 29, 2011 3:30 PM by  Memphis Mike
I was an active Java/web engineer until 2004 when I shifted focus to other things. I'm looking to get back into programming now, for personal projects and possibly working as a developer again. I am interested in learning some of the new languages that seem to have taken off while I was on hiatus. Would Clojure be a good choice? I was considering Scala or Python as well.
  Reply posted on Jun 29, 2011 5:03 PM by  Tim Robinson
All three would be good choices. Here's my view:

* Scala and Clojure will allow you to leverage your Java experience the most.
* Scala will probably be closer to your existing experience making it easier to learn.
* Clojure and Python are bigger paradigm shifts for you, making your learnings more enlightening.

With Clojure you'll still get to leverage your Java experience, while choosing a language different enough to challenge your pre-existing thoughts & ideas.
 Comment posted on Jun 30, 2011 1:50 AM by  YI
Thanks very much for this.  I'm an experienced clojure programmer but regardless, having a clear and informative site like this is a great boon for the community.

One thing that might be worthwhile is to include in the setup chapter a short blurb letting readers know that there are more comprehensive editing solutions available, and that jline is just introductory, in case some people are put off, thinking there is no editor support.
  Reply posted on Jun 30, 2011 9:49 AM by  Tim Robinson
I couldn't agree more. I will find time to add that in.
Thanks!
 Comment posted on Jul 01, 2011 9:51 AM by  Mark A.
"I decided that building a custom blogging platform was a better idea ..." and then you used a custom blogger Clojure? If you don't want a custom blogging platform, write it with PHP.
  Reply posted on Jul 01, 2011 4:10 PM by  Tim Robinson

I'm not sure what "...used a custom blogger Clojure?" is intended to mean. I can only presume you think Clojure is a blogging platform, when actually it's a general purpose programming language.

 Comment posted on Sep 08, 2012 5:44 PM by  Elango Cheran
I'm trying to pass Clojure learning resources to people who don't have good access to the internet and need to view this information.  It would be nice if there was a way to download the current state of your tutorial as a PDF (perhaps timestamped to prevent confusion).  If you decide to do that, let me know!
 Comment posted on May 14, 2014 12:03 PM by  TeoEi
И сюда запостил.
 Comment posted on May 25, 2014 2:57 PM by  LalaEi
и сюда запостил.
Would you like to leave a comment ?
Name (required):
Website (optional, creates link to name):
email address (private & optional, used for Gravatar):
Comment (required):
 (or Practice Markup Here)
Created by Blackstag Software Inc.Copyright Tim Robinson http://blackstag.com