First thoughts on Ruby…

August 29, 2006

I’ve heard a lot about Ruby on Rails over the last couple of years but I’d never really been intrigued to get it set up on my machine and ‘have a play’ with it so to speak.

It turned out to be a relatively painless process and after following the instructions on the official site I had it all setup within about half an hour which was a record for me for getting a development environment setup. With a bit of help from the Pragmatic Programmers Guide to Ruby I managed to get some basic pages setup. The design of the URLs and the separation of the code is actually fairly intuitive. Ruby on Rails uses the MVC (Model – View – Controller) Architecture/Design Pattern very strictly and the code for each of these is written in a separate file.

One aspect of this that made sense to me as a PHP programmer was the way that the URLs in Ruby on Rails are constructed in a “/[controller_name]/[action]” format. I also like the fact that everything in Ruby on Rails is an object, even such things as integers and strings. It takes a bit of getting used to but after using it for a bit it seems counter intuitive to do it any other way.

I don’t think I’m about to become an advocate for the use of Ruby on Rails for every development project I work on – I’m still a big fan of C# and the .NET platform and I find it unlikely that I’ll change my mind in the near future but we shall see!


Treading the thin line between life and death

August 27, 2006

As a new employee of ThoughtWorks I’m currently in Bangalore, India attending the ThoughtWorks University program for new graduates at the company.

Yesterday morning we went on a trip to Mysore for the day. It all started off fairly promisingly and we saw several palaces and many great photographs were taken. At just after 3pm we went for lunch at a very flash 5* hotel, and that’s where it all started to go slightly pear shaped.

I suffer from anaphylactic shock reaction to dairy products, eggs and nuts – so as a result I have been very very careful when checking what ingredients are in the food here because I really have no idea what they could be including in them.

I continued with this strategy yesterday and put onto my plate several things which I thought I would be perfectly fine eating. It tasted pretty nice and I didn’t seem to be having any immediate reaction to it. My mouth was feeling a little swollen on my lip but I’ve had that problem before just eating cucumbers so I ignored it for the time being. We left the restaurant and headed for an arts and crafts store about 20 minutes away. As we got closer my throat started to feel a bit weird but I was still breathing fine so I thought it would just go away. Then it struck – within 2 minutes of getting off the bus my throat really started to constrict and my whole body was feeling really hot and itchy.

After trying in vain to reverse the effects with some piriton tablets and asthma medication I had in my bag I realised I was in real trouble and could stop breathing within the next 30 minutes if I didn’t do something about it.

I quickly found one of the trainers and upon looking at my face realised that I was going to need to go to a hospital immediately. The symptoms of an anaphylactic shock reaction include the throat swelling making it difficult to breathe, eyes becoming swollen, nose running uncontrollably and sometimes a hive like rash all over the body. I had all of these symptoms within 2 minutes of the attack starting and as luck would have it there was a hospital just 1 kilometre away from the shop we were at. After a crazy 5 minute ride in a rickshaw to the hospital my throat was swelling even more and I was in need of adrenaline quickly. I had chosen not to use my epipen injection for 2 reasons: 1) I’ve never used it myself before and I didn’t want to do it incorrectly & 2) The hospital was so close by that it would have been an unnecessary waste of it.

I was quickly put on one of the hospital beds and administered with a dose of adrenaline that was double that contained in my epipen. My throat was still feeling severely swollen but it seemed to slow down the rate of deterioration. I was then put in a wheelchair and taken to the I.C.C.U unit in the hospital (I assume that means Casualty) where I was connected to a drip and had further injections administered. In total I had needles in my left arm, right arm, left wrist, right wrist and left thigh.

My discharge summary says I was given the following treatment:

I.V. Hydrocortisone 100 mg Stat
I.V. Dexona 2ml Stat
I.V. Avil 1amp Stat
S.C. Adrenaline 0.5ml

I don’t really know what any of that does apart from the last one which helps open the airways. I was told afterwards that my heart rate was plumetting rapidly. The doctor told one of the trainers that left untreated I would have suffocated within 12 minutes. The hospital actually wanted me to stay under observation for 2 more days but they released me after 3 hours so that I could return to Bangalore.

I only slept for about 5 hours last night – that’s what having your body pumped full of adrenaline does! Perhaps I’ll also have a little more credibility about the thoroughness with which I pick my food from now on.