Archive for August, 2008

Learning Ruby - Day 1.5

Sunday, August 31st, 2008

Ruby is truly infuriating. Not only are there six dozen different ways to instantiate a string but they vary in subtle ways. Single quotes interpret escaped characters and double quotes don’t and anything followed by percent becomes a quote terminator and even though double less than appends to strings, when followed by any non-space they also become a quote terminator and you call it a here document. And you can quote the terminators. So while a << "b" will add "b" to a, a <<"b" will expect a bunch of text followed by a freestanding "b" that terminates the here document. I can only imagine the BNF.

Why does anyone willingly write in this language?

Learning Ruby - Day 1

Sunday, August 31st, 2008

Things that annoy me (when coding it’s all in the syntax):

  • elsif is missing an e
  • resuce should be called catch or except or anything else but rescue
  • there are five dozen ways to say if x then y
  • :symbols
  • @@globals
  • case/when isn’t switch/case
  • parens to functions are optional

The combination of the above leads to things that are nigh unparsable:

begin @@master = case @slave when :dude: “dud” when :man: “chicken” else “rub” end if eyes.poke_out? elsif puts “Go learn python” resuce me

Entries (RSS)