Today I installed Grails on my work laptop.

And then set to try the quick-start example.

I soon ran into a problem when I tried to create my application using the command

grails create-app MyApp

I got the following error

The syntax of the command is incorrect

I spent some time trying to debug the grails.bat file – but soon fell back on time-tested strategy. If someone has solved it- Google will know about it !!!

And it turns out -I had not installed Groovy !!!

Hmmm – I would have thought either Grails should have had groovy bundled with it or at least politely warned me that I do not have Groovy installed.

And whatever happened to the good old message NoClasssDefFoundError ???

Anyways- once I got Groovy - things went pretty smoothly

And I had my simple app- up and ready in no time.

I also did the following…
Setup up my GROOVY_HOME and GRAILS_HOME
Setup the path to include %GROOVY_HOME%\bin and %GRAILS_HOME%\bin

I know – I would have discovered this beforehand- had I taken the time to read the readme.txt – but I think Grails team could have done a better job by prompting with a better message

 

Today I wrote my first meaningful program in Groovy-

It was a small script to extract some information from a XML

It took me the same time to learn Groovy and code this script- the same time it would have taken me to do it in Java.

The brevity of the program was breathtaking. Few lines of code- and I was on the way slurping away the XML.

Another first…

Being an OOP nut- its been ages since I have written a single line of code- outside a class. So today- I broke another barrier.

 

Last night I downloaded and got my first sample program running on grails.

I had been reading about grails for a while- so decided to check on the hype myself

And I was…fairly surprised- pleasantly to see what it had to offer

The time between downloading grails and having it up and running with a small program, not a hello word program – but an actual program which would list and add objects,  was somewhere between 10-15 minutes.

Doing the same thing in Java from scratch would have taken me- well ages.

I know Grails has a strong integration with Spring- so I guess it should be able to deliver lots if not all the advantages that Spring has to offer.

Grails is built on top of Groovy- which is in turn built on top of Java.

I for one do not want to retire Java – just because it has outlived its life and its time for more snappy languages to move in. The romance of somewhat new syntax while still have the familiarity of Java  doesn’t excite me too much

The luxury of not adding semi-colons at the end of line-may excite some people- but it doesn’t tickle me to death that I wont have to worry about any more. Years ago when i would struggled with compilation errors- yes at that time- it would have been a help- but personally its too late for me to benefit from this

The one thing that bothers me is the speed- since Groovy is  built on top of Java- it will be  factor slower than Java. That factor can be reduced but not eliminated.

What remains to see if does the advantages of Groovy outweigh this factor?

© 2011 Technology Cafe Suffusion theme by Sayontan Sinha