01 Apr 2009
I've been using Ruby ever since a good friend told me to jump on the Rails bandwagon when it was back in beta, around 2005. After having only programmed production code in PHP, Ruby was like, way hard, but I had to learn it because of peer pressure.
4 years later, after struggling needlessly through coursework and projects using Ruby (where I could have been using Java instead), I'm finally ready to ditch the beast. I've lost coding competitions because of Ruby's speed. I've stared at code for seconds and not been able to figure it out. I even tried to implement data structures in Ruby, and ended up doing them in C. People make fun of me on a daily basis when I utter the famous last words: "Ruby's not that slow..."
Anyways, it's 2009 and a good time as any to switch. I've been learning Haskell on the side, but it's not production ready. In my search for the ultimate Ruby replacement language, I stumbled on one called Python that seems to have some momentum going for it. I think some big companies are even using it in production! Anyways, here are some of the pros vs Ruby:
v = a.empty? ? a.shift : nil
if len(a) > 0:
v = a[0]
a = a[1:]
else:
v = None
sum([1,2,3]) in Python, whereas you would have to do [1,2,3].inject(0) { |sum, i| sum += i } in Ruby. Seriously????? Why is it called inject anyways. Ruby's authors were clearly not well at English. def getTime():
'''Returns a string timestamp in the form: 'Time hh:mm:ss' '''
...
def get_time
=begin doc
Returns a string timestamp in the form: 'Time hh:mm:ss'
=end
...
These are just some of the reasons that I'm moving over. Look forward to code samples and solutions in Python from me in the future!