Having tried Ruby/Rails quite some time ago (2007) and disliking the “magic”, I decided to give the dynamic duo another chance to see what the older me thinks of them today.
So far I dislike Ruby less :p. It does take a while to get the knowledge needed to successfully grok a non-trivial Ruby program. What with it’s “yield” statement, callable blocks and
<=> operator, it appears to be trying to please every type of programmer. But that’s ok.
What really got my attention was the catch/throw construct:
def i_throw_something() print "Please do not enter something bad " answer = readline.chomp throw :something_bad if answer == "something bad" return answer end catch :something_bad do i_throw_something puts "Great! something bad was not entered." end
It is as close to the much derided “goto/label” construct that I have seen since my glory days programming Apple Basic.
But!, The older me is more tolerant so even though I may disagree with the use of goto I do not question its presence. After all it is only the innocent programmers that are left to fend for themselves if there is language control. The bad programmers are already free to wield code in any of the “makes my eyes bleed” ways that they can think of. I commend Matz et al for the bold steps in allowing this and other not so well received parts into the language.
And I appeal to other language designers/committees give us our guns, er gotos, and at least a way to defend ourselves when/if we have the need.