Leaving aside Java for Clojure

…or shall I say “Leaving aside object-oriented programming (in Java) for functional programming (with Clojure)”?

I seem to be getting into functional programming with Clojure steadily. And I’m serious to have it under my belt. I seem to question all I learnt so far about object-oriented programming with Java and am quite often treading on people’s toes, esp. in the Java community in Poland (where I’m active the most).

I don’t question Java features or syntax, or the way Java programmers see things and moreover use Java for everything they design. I don’t even compare Java to Clojure (I wouldn’t be able to and could cause more damage than anyone could afford to accept). What I’m doing is to be asking questions about the purpose of using Java and its tools and frameworks in a given context – an IDE, design patterns, code-compile-debug-run cycle and such.

I think the main reason is that I began noticing things which I hadn’t been able to before Clojure.

It’s also part of my learning process where I think I should leave aside the emotional baggage to Java I’ve been carrying around with me for years. I must admit I learnt how to design applications with and in Java, and it took me years to grasp all the concepts which ultimately turned me into a seasoned Java specialist (a mixture of a programmer, a application designer and an architect).

I’m way too far from claiming I know how to effectively develop Java applications, but don’t think it would take me months to learn and accustomed to it (unless I’ve already).

I’ve already gone through a couple of books about Clojure (see my take on The Joy of Clojure, Practical Clojure and Programming Clojure and vote for them should they please you) and it turns out the reading list is not going shorter any time soon (see Clojure – Grundlagen, Concurrent Programming, Java, and Clojure in Action and, to be released soonish, Clojure Programming). It turns out that all the people who know Clojure well enough have already written a book about the language or are about to do so. It’s a hectic activity to follow along with their reading. Not an easy task after all, is it?

So, I’ve immersed myself in reading the books and in the meantime am trying to find a place for my new skill – programming functionally with Clojure. And, honestly, it’s not an easy task at all. Not after so many years with Java.

But I’m not giving up. Quite the contrary. I may have found a way out – I’ll be developing simple applications around Web development which I used to cover with various Java frameworks like Apache Wicket, Seam Framework, JavaServer Faces (JSF) or recently Grails and some others.

The idea is to follow the path many Java programmers do when they start developing their object-orientation with Java EE. It’s not only about Java Servlet, but a layer atop, be it the aforementioned JSF or Grails. I’m not going to build a yet another framework for Web development (which I don’t understand so well and don’t have time for), but am going to have a bunch of very simple examples of what I used to cover with Java that should ultimately help me to present the goodies offered by Clojure.

I wish I could also be working with someone interested in learning Scala or JRuby this way. I believe it could help me have another view on a problem with the other language’s solution which would eventually lead me to find the right one in Clojure. Ping me if you’re interested.

Should you have an idea for a very short demo with Clojure, I’d be happy to hear so. Even if it’s already managed by a library/framework in Clojure, I’m up for doing it again on my own hoping I learn Clojure better (when the sources of the solution are available and will be able to have a look at a solution).

I’m thinking aloud and therefore what I wrote may not be useable at all and won’t ever be. You’ve been warned.

Be Sociable, Share!
This entry was posted in Languages.

7 Responses to Leaving aside Java for Clojure

  1. Konrad Garus says:

    Here’s a thing I probably will implement to learn me some Clojure and that might be related to your interests: web app for “home fincances” based on Ring/Compojure and Incanter (incanter.org). Start small with something like tracking savings and investments, later expand to record spendings, budgeting etc. with a ton of graphs and views on this data.

  2. Jacek Laskowski says:

    Great idea! I’ve been thinking about it as well, and your comment only proved I was correct :-) I haven’t worked with Incanter, but have heard quite nice opinions on it so it finds its place in my toolbox soon’ish once I learnt Clojure with Compojure.

    Will you be using github for the project? What’s the repo?

    • Konrad Garus says:

      I suspect I’m on pretty much the same level in Clojure as you. I mean, I would enjoy sharing what I learn or even collaborating, but I have little experience or idiomatic knowledge so even if I publish something, take it with a grain of salt. :-)

      That project is still in the planning/gotta-get-myself-together-and-get-it-rolling stage. No github or anything to share yet, just some local spikes and a lib for converting form submissions (https://github.com/konrad-garus/yaclot).

  3. I’m going through these Clojure books, but what I’ve found very helpful is to solve problems from http://www.4clojure.com site. Trying to find solutions for problems makes reading much deeper.
    Great thing about this site is that once you solve a problem you can see solutions of other users and learn completely different approaches to the same problems (shorter, more readable, new uses of “known” functions, etc.). At least for me this way of learning the language and its usage is very stimulating.

    • Jacek Laskowski says:

      I’ve been hearing about the site for some time, however I haven’t visited it yet. No reason not to do so now. Thanks!

      BTW, do you blog about your experiences with Clojure somewhere? I’d love hearing from you about Clojure and the ups and downs while reaching the right solution for a task.

Leave a Reply

%d bloggers like this: