Home arrow Blog

Time to add another tool to the toolbox

One of the tenants of the Pragmatic Programmer is to learn at least one new language every year. Last year JavaScript was the language for me. Now don’t get me wrong, I “knew” JavaScript before last year. If you call knowing JavaScript knowing how to write a function and use low level DOM events, then yes…I knew JavaScript. However, over the last year, I have learned to respect JavaScript as a first class, powerful programming language. I have learned about object oriented programming in JavaScript. I have learned about DOM manipulation. I have used frameworks like Prototype, script.aculo.us, YUI, mootools and others to enhance the JavaScript I write. I now feel that JavaScript is a tool in my toolbox that I can competently develop robust applications with using it to it’s potential and knowing it’s limits.

With that being said, it’s time to move onto a new language. I considered a few different choices. The three finalists were Ruby, Groovy and Scala. I settled on Ruby for a few reasons:

  • I didn’t want Java. Don’t get me wrong. Java is my bread and butter. It’s the main language I use to develop with every day. It’s what puts a roof over my head. However, I wanted to learn about a language that would make me look at problems in a different way. Scala is billed as a “Java like” language. That was enough for me to say no to it for this exercise. Groovy integrates with Java too easily for me to go with it.
  • I didn’t want to be able to use Java as a crutch. Since I use Java every day, I was afraid that I would resort to using Java in places where I wasn’t sure or couldn’t easily find answers to questions I had. This was the main reason I didn’t go with Groovy. I am a huge proponent of the Groovy language and I love the Grails framework (once again, i feel like with Groovy, I am at the level I was with JavaScript two years ago), but I wanted to be forced to look at programming problems in a different way.
  • I wanted a scripting language. This was the final nail in Scala’s coffin for me. Part of the next year is I want to be able to write scripts to address a large number of the manual tasks we as developers face every day. I have played with the Ruby testing framework watir with much success and wanted to be able to take that to the next level.

So Ruby it is. I am currently working thru the book “Every day scripting with Ruby” by Brian Marick (Amazon). From there, I will begin diving into a more thorough exploration of the language, finishing up with Rails. I’ll keep you posted on my progress.

What languages are you learning this year? Let me know in the comments.

11 Responses to “Time to add another tool to the toolbox”

  • Keith Johnson responded:

    Good luck with your Ruby studies, Michael! I am currently learning Microsoft Visual C#. This seems to be the emerging language within
    the Microsoft-based market. All The Best, Keith Johnson, Hallandale, FL.

  • Alain O'Dea responded:

    I am learning Erlang/OTP. I mostly learned Erlang programming (the nuts and bolts of writing the code) last year, but never really got a good understanding of Erlang development: OTP, unit testing, automated builds, documentation, release management and refactoring. This year I intend to master those aspects of Erlang development.

    I have found Erlang very useful for complex automation like the Mercurial SVN integration I wrote. I have generally found Erlang very good for incrementally developed desktop automation scripts because of its pattern-matching and functional style.

  • ken responded:

    Learning Flex / Flash / ActionScript / AIR - so far HATE it/them.

    Easy yet complex - I will use Java/GWT when possible.

    Learning Ruby - understand the the supporting tools and frameworks are very good, and performance is reasonable, but from a core language point of very it seems poor compare to Python.

  • Jay responded:

    I’m learning Lua better, though I’ve used it in the past. I’m also reacquainting myself with PLT Scheme since 4.0 came out.

    I’d like to learn Erlang, F#, or Haskell in the near future but I don’t have any projects I yet consider amenable to them.

  • Edoc responded:

    REBOL http://www.rebol.com/index-lang.html

  • Swami Atma responded:

    Hi, nice article. You might want to replace the word ‘tenants’ with ‘tenets’

  • Daniel Spiewak responded:

    Personally, I think that Scala is enough unlike Java to qualify as a good language to learn. More importantly, it stands perfectly in the gap between imperative, object-oriented languages and the heady marshes of functional programming. Regarding the Java-like:

    object Driver extends Application {
    val nums = List(”1″, “daniel”, “2″, “chris”, “joseph”, “3″, “4″, “renee”, “5″)
    println((0 /: (nums flatMap { try { List(_.toInt) } catch { _ => Nil } } map { _ * 2 })) { _ + _ })
    }

    Ok, I’ll admit, it’s cryptic for the sake of being cryptic, but you get the picture. Scala can be expressive in many ways which are simply impossible — or very very cryptic — in Java.

    For the record, there are many ways to make the above less…insane. :-) The output is: 30.

  • Paul King responded:

    In Groovy, the above Scala problem would typically be solved with something like:

    nums = [’1′, ‘daniel’, ‘2′, ‘chris’, ‘joseph’, ‘3′, ‘4′, ‘renee’, ‘5′]
    println nums.findAll{ it.isNumber() }.collect{ it.toInteger() * 2 }.sum()

    Or with a little bit of Closure refactoring:

    isNumber = { it.isNumber() }
    doubleOf = { it.toInteger() * 2 }
    println nums.findAll(isNumber).collect(doubleOf).sum()

  • SeanJA responded:

    You do realise that there is jRuby which has (I quote) “Support for interacting with and defining java classes from within ruby”. Which could be good or bad based on the reasons for languages you wanted to avoid…

    As for languages I am learning… I wanted to try out Cyclone… but I couldn’t get it to compile… so I think I will be working on Ruby as well actually…

  • Roberto Carlos Gonzalez Flores responded:

    I’m learning Phyton.

  • Thamizharasu S responded:

    I am learning JavaFX now. This is not officially released. But enough materials available.

Add your own comment...