Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Clojure vs other JVM Languages

Ranch Hand
Posts: 462
Scala jQuery Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm a Java developer and have been messing around with Scala (via Coursera) and was just wondering what the differences are between Clojure and Scala? Why choose Clojure over Scala?
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would it is a matter of "culture" and "requirements".
If you need a powerful typing system, the ability to mix OOP and FP and Actors model for concurrency (Akka is available for Scala & Java btw), then go for Scala.
Of course this doesn't conclude what Scala is all about but I guess those are the strong selling point for Scala programming language.

Go for Clojure if you want to code in Lisp, a filthy rich data structures implementation, have a powerful Macros systems, a dynamic language and an easy concurrency model to implement multithreaded applications.
When doing multithreading in Clojure, I always feel I'm coding it in Apple's GCD which it is awesome!
Posts: 2407
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did the Coursera Scala course last year and enjoyed it immensely. Then I did the excellent Coursera "Programming Languages" course, which included a section on Racket (a variant of Scheme Lisp) and a lot of core work on functional programming. So I have almost enough knowledge of Scala, Lisp and FP to be dangerous but nowhere near enough to be useful (yet). I really like the functional programming approach - even if I'm still struggling to apply it intelligently - and I liked the conciseness and power of Scala compared to "enterprise" Java. It seems I'm not alone there, as a number of major companies are using Scala to rationalise their JVM development (and goodness knows, JEE needs some rationalisation!). Incidentally, check out The Well Grounded Java Developer for some good stuff on polyglot programming on the JVM, including Scala and Clojure, or Seven Languages In Seven Weeks for an introduction to several different languages (incl. Scala and Clojure) and paradigms both on and off the JVM.

But Lisp really blew my mind and made me laugh out loud in sheer delight at the elegance and flexibility of a language that initially seems to consist of nothing but parentheses. For the first time in years, I felt like this was a language that I could really enjoy exploring and trying to get to grips with - even more fun than Python and much more challenging - so I decided to start finding time to look at Clojure more seriously, although it's still early days. No idea how far I'll get - I'm no CS wizard and my day job requires me to toil in the Java EE mines like a medieval serf, but it's good to have aspirations, eh?

Of course, I'm new to both Scala and Clojure (and FP) so what do I know? In any case there's no sense getting into language wars, especially when both of these languages are still on the periphery of mainstream commercial software development and will never replace Java as the "IBM" choice for the "enterprise". But for me personally, the key factor that lifts Clojure above all the rest (even Python) is that it's fun - and when I'm struggling to find a few hours to play around with a new language and a new programming paradigm, fun is a really important ingredient.

So my $0.02 on your initial question would be: unlike most Java developers, you've already got a grounding in FP and Scala, so why not look at different ways to apply the FP approach by playing around with Clojure to see if you like it? Even if you decide not to take it further, you will learn some interesting things along the way and it will almost certainly change the way you look at programming in general. And Paul Graham's essay on Beating The Averages with Lisp is still worth reading if you need further inspiration.

Have fun!
Your mother is a hamster and your father smells of tiny ads!
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic