02 Apr
Posted by: Matt in: CodeProject, dynamiclanguages, goals, grails, groovy, programming
In 2007 I established several professional development goals (and later reported my progress on these), one of which was to learn Groovy and Grails. This goal stemmed from the continually referenced idea from The Pragmatic Programmer to “learn a new language every year.” This idea has become so ubiquitous that it even has it’s own four-letter acronym, LOTY (Language of the Year).
Since establishing and reporting on these goals, I’ve had several things get in the way of fully realizing all of them. However, I can safely say that in the last two years I have mastered enough Groovy and Grails that they no longer fit in the LOTY category. At this point they’re really not showing my anything that is causing any paradigm shifts for me. They’re comfortable. When I learn a new feature, it just seems to make sense, and nothing surprises me anymore. Languages like these aren’t good LOTY candidates because one of the purposes of learning a LOTY is to challenge and change your ideas about programming. Groovy doesn’t do this for me anymore. It’s time to move on (not to say that I’m dropping Groovy and Grails as a tool - I’m using them more now than ever - they’re just not a learning tool for me anymore).
So, at this point I want to delve into a language that attempts to tackle the concurrent/multicore programming challenge. I’d like to stay on the JVM because I appreciate the benefits that it brings as a platform, so for now Erlang is out. The two leading candidates in the JVM/concurrent/multicore arena seem to be Scala and Clojure. An added benefit of both of these languages is that they support the functional paradigm, something I haven’t really played with since my computer science education days and a very interesting language named Haskell.
Scala is a multiparadigm language, supporting both object-oriented and functional constructs. It is statically typed, yet offers very nice type inference. Clojure, on the other hand, is a functional Lisp derivative with almost no OO constructs that is dynamically typed. Both are designed to enable concurrent programming. Which one do I choose? I open the floor for comments.
16 Responses
Mike Mayo
02|Apr|2009 1I felt the same way after spending a year with Ruby on Rails. I love Rails, but there’s nothing new for me. While I haven’t gone after concurrency, I have gone into a functional/OO split with Objective-C and building iPhone apps. So that’s my LOTY
Keep posting! I want to know how this turns out.
Chris Roberts
02|Apr|2009 2I vote for Scala. Besides having more of a following right now (and thus more books and resources), it’s a functional/OO hybrid, so it can server to ease you into the more functional Clojure for next year. Plus I hear Twitter is using it, so you know it’s cool
Mark Volkmann
02|Apr|2009 3I vote for Clojure. If you want to learn about functional programming, I think you’d be better off using a language that isn’t an functional/OO hybrid. That will force you to do things in a functional way instead of slipping back into OO habits.
I wrote an article on Clojure that can help you get started quickly. See http://ociweb.com/mark/clojure/article.html.
Floyd Gantt
02|Apr|2009 4+1 Scala
Ricky Clarkson
05|Apr|2009 5I suggest Scala. Scala supports both FP and OO, true, but you can restrict yourself to a small amount of OO. I find that quite comfortable. Scala has a typesystem; functional programming with a typesystem is a very different experience to without.
That said, learn a lisp sometime, clojure or not.
mateusz.f
05|Apr|2009 6+1 Scala
Matt
05|Apr|2009 7Hmmmm….so currently it looks like:
Scala 4
Clojure 1
Yet the argument for learning Clojure is extremely compelling….I worked with Scheme while in college and it was quite a bit of fun toying around with a Lisp, and it would be interesting to try again. That being said, I hear a whole lot more about Scala and am intrigued by the buzz. This is a hard call regardless of the wide-margin in the voting….
Tim Dysinger
06|Apr|2009 8+1 Clojure but by all means learn both and choose.
I choose Clojure after 5 years C/C++, 10 years of Java, 4 on Ruby and 1 yr each Erlang & Lisp. I like Dynamic and Functional.
If you like Static and AOT Compile then Scala. Both languages have really neat features.
One word of caution is that you can program imperative Java easy in Scala and it would be easy to fall back into old Java habits (not learning anything).
LOTY…Part Deux by Matt Stine’s Blog
06|Apr|2009 9[...] A few days ago I pontificated on my need to choose a new “Language of the Year.” Right now I’m attempting to choose between Scala and Clojure. If nothing else, I’ve learned from this exercise that asking the community for feedback is a GOOD thing. Your comments have been very helpful. [...]
Greg
02|Jun|2009 10As much as I’m interested in scala, and am looking at how to “sneak it in” to my current project, I say go in deep for clojure. Why/how?
I stumbled across a fantastic online book “Practical Common Lisp” http://gigamonkeys.com/book. It shows real-world samples of using Lisp, including writing a unit test framework in less than 50 lines of code, along with an MP3 database and HTML generation library. At least the introduction chapter. It hooked me.
Now for the kicker, another guy wrote a corresponding blog, showing the equivalent solutions in Clojure! http://blog.thinkrelevance.com/2008/9/16/pcl-clojure.
Anthony
12|Jun|2009 11If your goal is to learn and expand your mind, definitely Clojure.
Nothing like a Lisp to show you how powerful a programming language can really be.
If you go the Scala route, you’ll just end up using the same constructs you are comfortable with, so where’s the learning?
Kanwa
07|Aug|2009 12Please don’t attempt Scala or Clojure. Neither any scripting lang.
Stick to Java as you will face problems related to data type.
Eg: Can you tell me what types are passed here in the function argument
public void runMyFunc(dob, favy)
{
}
If long code(> 500 lines) like the above one is written, we never will understand
what’s happening in the code and worst if you check your code after say two
months, you will weep to understand the code because you don’t know what is
dob or favy is.
You will break your head on try to figure out what “dob” is —
an object or int or what?
Your LOTY shud be FOTY (F- Framework of the year)
Cheers,
Kanwa
tek
16|Aug|2009 13@Kanwa: Scala is a static typed language, no “scripting lang” or dynamic lang.
kanwa
30|Aug|2009 14Oh Telo!
Sorry if I sounded wrong. I did not mean to say that Scala is a scripting language.
I just meant that don’t learn scala (or) scripting languages.
For the quote you mentioned “Scala is a static typed language” part, I beg to differ
as I found this in the home page of scala under Introduction:
“Scala is a general purpose programming language designed to express common
programming patterns in a concise, elegant, and type-safe way.”
What is this type-safe way they mentioned? you know better
Thanks
Kanwa
mawdo
01|Nov|2009 15I’m at a similar stage and have taken a look a detailed clojure [and an inital squint at scala and erlang] and have been pretty impressed - clojure feels my natural next step having work a long time with traditional OO and more recently with ruby and DSLs - I’ve been describing my ruby based DSLs a kind of macros that inflate my ruby env - a principle you’ll see embedded in clojure - the other shift clojure brings for me is functional programming and I’m trying real hard by practicing thinking in this way - its kinda of like the way you had to force yourself to think set-level RDBMS or the XSLT processing model in the past
ruby reignited my programming fire - clojure have added another boost
Steve
12|Nov|2009 16@Kanwa
Please at least do a little bit of Google leg work before commenting on these languages. You state that:
”
Stick to Java as you will face problems related to data type.
Eg: Can you tell me what types are passed here in the function argument
public void runMyFunc(dob, favy)
{
}
”
While your argument is one that I would agree with (loss of legibility due to lack of types) Scala does not suffer from this problem - your example would have to look something like the following:
def runMyFunc(dob: Date, favy: Int) {}
Looks pretty statically typed to me!
Later you make this comment:
”
What is this type-safe way they mentioned? you know better
”
Exactly *what* are you talking about? Do you have a different definition of type safety than everybody else? Perhaps it would interest you to know that Scala is *more* strict about types than is Java.
Next time use The Google. It is your friend.
Leave a reply
Search
Speaking Engagements
Memphis/Mid-South Java User Group
Real Developers Read! - Delivering Value
January 21, 2010 - 6 PM
Memphis/Mid-South Java User Group
Polyglot OSGi
April 15, 2010 - 6 PM
The Lambda Lounge
St. Louis, MO
Polyglot OSGi
February 4, 2010 - 6 PM
Mid-South Software Symposium
April 23-25, 2010
Memphis, TN
Northern Virginia Software Symposium
April 30-May 2, 2010
Reston, VA
Twitter
follow mstine at http://twitter.com
Categories
Archives
Blogroll
Leader of the Memphis/Mid-South JUG
Pandora
Meta
A design creation of Design Disease
Copyright © 2007 - Matt Stine’s Blog - is proudly powered by WordPress
InSense 1.0 Theme by Design Disease brought to you by HostGator Web Hosting.