Archive

Posts Tagged ‘Groovy’

Code as data != closures

February 1, 2006 Leave a comment

I was just taking another peek at the Groovy site and notice this beauty:

Code as data (a.k.a. “closures”)

They should get their facts straight!

Categories: Programming Tags: ,

Java…Ruby…Groovy

http://onestepback.org/articles/groovy/groovyspeed.html

If you read the entire article above please note that closures have *indefinite* extent , not *dynamic* extent.

Static versus dynamic attitude

February 22, 2005 Leave a comment

I think Bill is dead-on-the-money with the different-language, different-mindset thing. Java can make you feel guilty alright :-). Even when you can get over your own guilt, there’s the struggle with your colleagues who may not have a dynamic mindset.

I’ve been programming in JavaScript lately (actually more ActionScript 2.0 but some browser based JavaScript too). You’d probably return a single object there rather than multiple:

    var context = ExamplePage.process();

followed by code using context.forumID, context.reply, context.subject and context.body.

Single objects are constructed easily in JavaScript:

    function process() {
        // Do some processing...
        return {
            forumID: ...,
            reply: "a reply",
            subject: "a subject",
            context: "a context"
        }
    }

This is a very lightweight approach. Another poster had a similar solution in Python. There must be a similar way of doing this in Ruby or Groovy.

It would be great to use Ruby/JRuby, Groovy, JavaScript, Python/Jython or whatever on the Java platform. What’s needed for adoption is buy-in by vendors like Sun and IBM (so that project managers and other developers don’t have a fit when something without the .java or .xml file extension is checked into the repository). It would be nice to have support for these languages in Eclipse (say) with all the usual bells-and-whistes Java programmers have come to rely on to get stuff done – code completion, Javadoc lookup, hyperlinking, refactoring etc. Groovy seems to have alot of momentum including a JSR thing – so maybe something along these lines is not too far away. Maybe it’s already there and I just haven’t looked!

BTW – have you heard about NoXML? It’s this great new XML technology…

Follow

Get every new post delivered to your Inbox.