Friday, November 27, 2009

Grails - infuriating

I am doing a bit of work in Grails at the moment. For those who are going: "What??", it's a web framework, which intends to allow a developer to build web applications quicker, or better, or easier.

Overall, it is a bit of fun, easy enough to get off the ground, and you don't seem to have to write a great deal of code to get a great deal of result. But doing anything beyond a simple website it seems to get you into ever increasing layers of complexity and time-consumption.

The things I most dislike about it are:

  • There does not seem to be a lot of information out there on it that is beyond the simple stuff, airports and flights, books and authors. I find that if you add the words "finally found an answer" to the google search, it leads me more quickly to helpful people who are also trying to do non-simple stuff.
  • The documentation, particularly the "Guide" is reasonably good and (for a change) well-written, but so many important nuggets of information are buried in it, you find yourself reading and re-reading the same section of doc over and over to try to find answers. You know the answer has to be there somewhere.
  • The specs seem to change markedly from one version to the next. Little things mainly, of course, but it potentially means that when you think you have found the answer to your question, you have to be careful that the answer is still current to the latest version.
  • The community seems to contain more than it's fair share of "that's the way it is, deal with it", or "it is simple, you are stupid" people. It certainly doesn't encourage asking questions when you see some bloke get his arse flamed off for asking the same dumb question that you had. No I didn't notice the subtleties in the previous answer, thanks for pointing them out and displaying your obvious superiority.
  • The Exceptions that are generated when things go wrong in the app are way out there. I guess this is as a result of the way it's built on top of Groovy on top of Java with potential other helper frameworks jammed in. But struth, if it's a database error, then tell me it's a database error and not some other obscure error.
  • Grails uses Hibernate for database access, and getting it to work with an existing database is a real trial. Days worth of work, trust me. Oh so you DON'T want an intersection table with that simple one-to-many relationship? Well you're doing it wrong then. Whether it's complexity is Hibernate's fault or Grails's is debatable, but cripes, sometimes I wonder whether it's easier for me to write a simple SQL query. Much easier than trying to wade through the Hibernate documentation as well.
  • And finally, some things just don't seem to work as advertised. Or perhaps I didn't read the fine print in the advert? For example:

    //// A bug? ILike doesn't seem to work here and an exception is thrown.
    //// At least in this case, the exception is meaningful!
    //list = Customer.findAllByNameILike(params.ajaxParam + '%')
    //// The following does work, though.
    def crit = Customer.createCriteria()
    list = crit {
        ilike('name', params.ajaxParam + '%')
    }


I am not giving up on it yet, it will just take me time to learn. I am thinking though, when I compare it to my experience learning Struts, that while I spent a LOT more time writing code to get to a certain level, I spent a lot less time finding out how to do things. With Grails to get to the same level, I spend a LOT more time finding out how to do something, and then writing two or three lines to code it up! The time spent seems to be about the same.



I am also thinking that Grails may not quite be the Holy Grail of webapp development that I originally was hoping for.

Tuesday, November 17, 2009

Top 100 Books Update

I'm still continuing with reading my list of Top 100 books. Refer to this article. Over a year since my last update. One thing I am noticing, looking at the dates I have started and completed the books in my little tracking spreadsheet, is that large or hard books slow me right down. While this may seem obvious, it is more than just a simple words-per-minute ratio. Hard books tire me out, and I usually end up having a break from reading, or resorting to familiar, small or kids books immediately afterwards.

These are the latest read in order of finishing:

  • The Berlin Stories — Christopher Isherwood. A bit different to Cabaret. Really.
  • The Picture of Dorian Gray — Oscar Wilde. Spooky.
  • Treasure Island — Robert Louis Stevenson. Rollicking.
  • One Hundred Years of Solitude — Gabriel Garcia Marquez. I really liked this one.
  • The Thirty-Nine Steps — John Buchan.
  • The Great Gatsby — F Scott Fitzgerald. Strange. I've read this before and remember it as mainly a "fun" book. How wrong I was.
  • Lord of the Flies — William Golding.
  • Frankenstein — Mary Shelley.
  • Moby-Dick — Herman Melville. I read this via Daily Lit, one page per day.
  • The Stand — Stephen King. I chose his most recent version, with all the cut out bits added. The ending stretched on and on and on.
  • Guards! Guards! — Terry Pratchett. Funny.
  • To Kill a Mockingbird — Harper Lee. Not sure if the movie spoiled it for me or not.
  • The Executioner's Song — Norman Mailer. Creepy. Long and drawn out.
  • BFG — Roald Dahl. The Queen?
  • Charlie And The Chocolate Factory — Roald Dahl.
  • Charlotte's Web — E. B. White. And then I watched the cartoon.
  • The Lion, The Witch and the Wardrobe — C.S. Lewis. OK. Enough children's books already.
  • Pilgrim's Progress — John Bunyan. Another Daily Lit read. Tortuous. But I'm sure it is responsible for saving someone's soul.
  • The Hitchhiker's Guide to the Galaxy — Douglas Adams.
  • The Catcher in the Rye — J.D. Salinger. I really don't think this helps me understand John Lennon's killer. Not that I really want to.
  • Lucky Jim — Kingsley Amis. Amusing.
  • Things Fall Apart — Chinua Achebe. Unexpectedly good.
  • Harry Potter And The Philosopher's Stone — JK Rowling.
  • Harry Potter And The Chamber Of Secrets — JK Rowling.
  • Matilda — Roald Dahl.
  • Money — Martin Amis. It took a long, long time for me to get into this one, and then I got into it, and rushed it at the end to finish it. Martin Amis turns out to be Kingsley "Lucky Jim" Amis's son.
  • Huckleberry Finn — Mark Twain. I struggled with the American patois.
  • The Portrait of a Lady — Henry James. Daily Lit again but in two parts. So just when you finish the first you realise there is a whole second-half of the story to go. Why say two words when you can more eloquently express the fullness of your ideas in a more abundant literary manner.
  • The Prime of Miss Jean Brodie — Muriel Spark. Yeah, I liked this. I'm sure it was shocking in it's day.
  • Lolita — Vladimir Nabokov. I struggled for ages with this. Dare I say: a little bit boring.
  • The Unknown Terrorist — Richard Flanagan. This is one of those books you read and immediately think it is preposterous, and then it gradually eats into you, and you start closely reading the news for hidden agenda. I rush read it the story was so good. Yea gods, one of the characters in this lives in Panania. Panania. That's the suburb next-door to where I was raised.

My current Daily Lit read is David Copperfield (Part 124 of 447). This is a bit embarassing, because I was supposed to read this for English in High School, but I ended up giving up quickly and reading the Brodie's Notes on it. I must admit I like it better the second time around. The book by the side of my bed is Part 1 of Lord of the Rings, and my read-on-the-bus book is The Wide Sargasso Sea. This latest is a very hard book to read in an environment that is conducive to travel sickness.

Saturday, November 14, 2009

My son and I

Yesterday I went into the kitchen, and tripped over our son's toys and plates that he'd pulled out of the cupboard. I said a couple of swear words, cleared things up and went out to the loungeroom. It was covered in musical instruments, mostly guitars, sound gear, music stands and music that I had left everywhere.

We're not really that dissimilar.

Reminds me of that great line from Men Behaving Badly (the English version) when Dorothy and Gary are having a baby, and Dorothy laments about now having two flatulent little bastards with a breast fixation.