Tuesday, October 26, 2010

Ruby

I recently had to learn Ruby, at least, in the form of IronRuby. So far, my experience with it is good. Admittedly at first I thought that it was just another language, but after trying it out, it actually felt good working on it.

I have to point out though, the biggest misconception by the more fanatical supporters of Ruby. Ruby seems to be "agile" language. Thanks to the fantastically successful Basecamp application, Ruby has become the champion of agile software development.

Well, sorry to burst your bubble, but agile is about people over tools. Ruby is just a tool. A good tool, but it's still a tool. Improperly used, it can still result in a horrible project. Bad Ruby code is still bad code. Hell, it may even be worse than bad COBOL code.

At least most of the COBOL code out there, 5 billion or so lines, works.

Tuesday, October 5, 2010

DB or Code

I once had this feature to implement. There was a database table that had a list of user ids, gate ids and dates. The table stores this data so that it can track who passes at which gate. Users who do not use their ids at the gate will be caught.

Anyway, I could put the date calculation logic in one of two components. I could either put it in the database, as a field in a view. I could also put it in a class, as a method.

As much as I'd like to weigh in the pros and cons of both approaches, I don't think I can. I don't have enough experience as an architect, or a database designer to give proper advice. However, I do have this one bright idea.

Put it where the possibility of screwing up is less!

Because I was better at using the date calculation functions of the database than I was at Java (I hadn't discovered joda time yet) , I put it there. It worked out too!