Monday, 11 June 2007

Groovy vs. Ruby

Both are very compelling and provide with very powerful abstractions...

but...
  • I don't really like the syntax in Perl and unfortunately Ruby is living in that space..
  • Groovy seems a bit lagging behind in areas like parallel assignment
  • No good IDE support overall, maybe next year :)
despite that...
  • Groovy really shines with its natural Java blending capability
  • I love the Grails project, showing what is possible with Spring and Hibernate
  • Dynamically typed languages are just sweet... write less and no interruptions in your flow
  • Groovy just added Annotation support, that is way cool
I devoted some nerd-time to learn both last year and I really enjoyed the exposure. I think its important to experiment with different conceptual tools such as programming languages from different paradigms as it expands on the set of potential solutions you can dream up for a particular problem.


So for example...
Say for example how nice it would to be able to do something like this in Java:

Map stuff = {"locale" : "en", "theme" : "basic" }

...but of course we cant so we have to resort to something like this:

Map stuff = CollectionUtils.asMap(new String[][] {
{"locale", "en"}, {"theme", "basic"}} );


There is nothing in Java that is called CollectionUtils.asMap(String[][] map) so we have to create this ourselves, but without the exposure to the Map construct in a higher level language like Groovy it would be less likely that we would create a method asMap() as in the example above just because we had not experienced or perhaps not understood the power of such an abstraction.

Hmmm, so why is this so powerful, well it has to do with expressiveness and preciseness. Math is an excellent example of how you can cram vast amounts of precise knowledge together to describe a phenomena in nature... but just as Perl its syntax is quite obnoxious. I think I like math more :)

No comments: