Quick facts about me : I’ve been developing JAVA web apps (Spring/hibernate) for 5 years and in fact stepping outside the JVM is a major hurdle for me. I’ve been using grails for the last 1-2 years and rails now for the last month.
I am perfectly happy with grails, and would definitely consider it in taking up new projects.
But there are specific frustrations I experience with grails, and things in the rails world I’ve always envied. Now that I've taken the plunge I want share some of my personal reasons for jumping ship, at least for the next project. I will hopefully make a more balanced comparison of the two in hindsight.
Approaching my grails work with a test-centric approach I had built up a few frustrations over time. The startup time is terribly slow and whilst there are solutions out there with --interactive I had opted to just run units directly from my IDE and forego integration tests. This means however losing the ability to test hql queries or test controllers that render json or xml.
compare this to rails ‘autotest’ which hooks into growl and testing has never been sexier! It’s also a little disconcerting to see no real community focus on testing in grails. I’ve seen a lot of grails “build twitter in 20” minute presentations where the speaker foregoes writing a single test! In contrast most rails presentations I saw have this built in to the talks, even doing real TDD.

My rediscovery of VIM! Since teaching myself to touch type (thank you Steve). And having my hands constantly on the homerow, it made VIM the natural progression for enhanced text manipulation and subsequently eliminating the mouse. There is a basic vim grails plugin out there, but Tim Pope has made a truly amazing rails plugin with haml and sass support and much much more. Seeing this pop up again and again in screencasts about VIM definitely peaked my interest.
Groovy 1.8 was a little disappointing for me. Perhaps I just don’t get it yet (very possible), but the focus on annotations and AST transformations feels ugly for me. I like my runtime meta magic.
CodeNarc (for grails) has definitly found a perfect use case for AST’s but I remain wary of real precompilation changes. I prefer to see new and powerful DSL’s as a feature of the language itself (see Scala’s map syntax =>) rather than hacking into the core.
I started looking at the source code for rails, and its a work of art. Even before I had wrapped my head around ruby I could read and understand most of what’s going on. The unit tests are small, usually blocks of less than 5 lines, and its a real tribute to beautiful code. If you’ve never looked at it I strongly urge you to take a peek, even without ruby knowledge.
Coming from java where tests usually bloat with mocks and end up much larger I had a real desire to find out more about this. Was it our java syntax and libraries causing complexity or did the rails folk just structure their code better and could I really learn something here. (I think its a mix of both)
One thing that really bugs me about grails is that is it largely written in java. I understand that makes sense, but it feels like a lack of trust in the language. Certainly Lift is written in Scala, so why doesn’t that fact transpose for grails.
The grails world is filled with programmers who come from a strongly typed background like myself, and metamagic is brand new and a little scary. Groovy offers a great way to gradually make the transition from java.
Yet rails is filled with people who think static typing is just dumb. I’m not sure why yet, but I’d rather see the world through their eyes in order to understand than to remain within my existing paradigm / community.
blog comments powered by Disqus