General

Uncle Bob on XML

I’m trying to catch up to my overflowing Google reader, and have just seen Uncle Bob’s posting on XML “The Hidiocy of XML Languages“:

Look, writing in XML is hideous. It’s wordy, it’s error-prone, it’s arcane, it’s redundant, it’s redundant, it’s redundant, it’s… HIDEOUS! To make matters worse, we have been embedding OTHER languages INSIDE this horrible container. EGAD! YIKES! ZOUNDS! FORSOOTH! This is just plain nuts, stupid, idiotic, retarded, poo-poo-headed, silliness!

All I can say is AMEN!!! And it just gets better.

I’ve never been a fan of XML. Yes, it does have benefits as a data transfer mechanism, though even that is questionable. Take the ACORD standards as an example. This is the standard schema for defining interoperability standards for Insurance Company operations/transactions (Quotes, etc). Fair enough, this can be very useful for companies to work together. However, each insurance company has it’s own way of doing business, and may not use the schema in the same way. ie a Policy for this company (or even Line of Business) may not mean the same as for another. So, how interoperable is that?

XML sucks. Its better than binary, or — shudder — ASN.1, but it still sucks, and should not be used as a language. Thank you Uncle Bob for your rant! It makes me that maybe, just maybe, I’m not as insane as people think when I tell them that I hate writing logic in XML.

Design
General
Software Development
Thought

Comments (2)

Permalink

InfoTec 2007 Presentations are online

I put my InfoTec 2007 presentations online last night. If you don’t want to hear about how much fun I had giving them, here is the link.

My first talk was a 4 hour “Introduction to Ruby on Rails”. It had a decent turnout, and was a lot of fun to give. Thanks to a IM chat with Harish the night before the talk, I gave the best line I’ve given so far in a talk (IMHO): “So, what type of web application would you like to build today?”

My second talk was “Agile Java Web Frameworks”. There were twice as many people in this talk that had signed up before the conference started, though slightly fewer than in my rails talk. A slightly disjointed talk, I hit upon some of the more interesting web frameworks in the java world: Struts2, Spring MVC/WebFlow, Click, Rife, and then the dynamic contenders: Grails, Rails, and Lift.

Click was an interesting experience, as I had only learned about it the night before from Stephen Haberman. It looks pretty promising.

We only had enough time to quickly dive into one of the frameworks, and the audience chose Grails. So we delved into the bowels of GroovyQuiz and I showed them how it works.

Overall I had a lot of fun, and am looking forward to next years InfoTec.

AJAX/Web 2.0
Agile
General
Grails
Java
Rails
Ruby
Self
Speaking

Comments (1)

Permalink

Simple Groovy script to remove .svn directories

The other day I needed to remove a mess of .svn directories from a project as I moved it from my personal box (using svn as the soure control) to the client’s source control system. This is a fairly frequent task, so attempting to be a “productive programmer” I decided that I would take the time to write a script to do this for me. After testing, it took about an hour to write… mainly because I tried to be too fancy, and tried a few things in Groovy I had not seen before. Overall, it was an hour well spent:

  1. search_for(“.”)
  2.  
  3. def search_for(dir) {
  4.         homedir = new File(dir)
  5.         homedir.eachDir {
  6.                 if (it.name == “.svn”) {
  7.                         println it.canonicalPath
  8.                         deleteDirectory(it)
  9.                 }
  10.                 else {
  11.                         search_for(it.canonicalPath)
  12.                 }
  13.         }
  14. }
  15.  
  16. def deleteDirectory(dir) {
  17.         dir.eachDir { deleteDirectory(it) }
  18.         dir.eachFile { it.delete() }
  19.         dir.delete()
  20. }

14 lines. I really like the eachDir and the eachFile methods on the File object… and there is even an eachFileRecurse. All I can say is: where the heck is the eachDirRecurse??? Oh well. It was still a good learning experience, and now I have a malleable tool next time I run into something similar.

General
Groovy
Java
Software Development

Comments (7)

Permalink

GroovyQuiz.com is finally here!

Earlier today I put GroovyQuiz.com online, along with its first quiz (Anyone up for a game of Life?)

It amazing to see the response its getting already… there are a number of sites linking to it already (Thank you aboutGroovy.com and groovyblogs.org… you both rock!). And I’ve got a number of solutions (one in under 3 hours!) to post as soon as I finish up that section of the site.

General
Grails
Groovy
Software Development

Comments (3)

Permalink

Creating an RSS feed in Grails

I am in love with Groovy’s Builders… they make working with heirarchical structures a breeze. For instance, I needed to create an RSS feed for GroovyQuiz.com, and the builders make that so easy:

  1. // … in a Controller somewhere far far away …
  2.         def rss = {
  3.                 // render some XML markup to the response
  4.                 def url = “http://groovyquiz.com/groovyquiz/main/quiz”
  5.                 render(contentType:“text/xml”) {
  6.                         rss(version: “2.0″) {
  7.                                 channel {
  8.                                         title “GroovyQuiz.com - Latest Quizzes”
  9.                                         link “http://groovyquiz.com”
  10.                                         description “Weekly Groovy language challenges to help you learn”
  11.  
  12.                                         for(quiz in Quiz.latestActive())
  13.                                                 item {
  14.                                                         title   quiz.title
  15.                                                         link    “${url}/${quiz.number}”
  16.                                                         description     quiz.description
  17.                                                         pubDate quiz.publishedDate()
  18.                                                         guid    “${url}/${quiz.number}”
  19.                                                 }
  20.  
  21.                                 }
  22.                         }                     
  23.                 }            
  24.         }

General
Grails
Groovy
Java
Software Development

Comments (1)

Permalink