The Right of the People to keep and bear infamous language constructs

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.

Advertisements
This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s