Design Element
Comment on "Sanity Checking for Scripting Languages"
by Scott Guelich — Dec 24
As Cameron mentioned, Perl provides exactly what you want in the form of use strict and the even more pedantic use warnings.

I've become more and more interested in Ruby, but one of the hardest things to give up from the Perl world is this kind of basic sanity checking, which really isn't hard for a script interpreter to provide.

Another Ruby custom I've had a hard time getting used to is omitting parentheses when calling methods without arguments. In most languages parens are required for argument-less methods/functions, and with Perl you have the leading punctuation to differentiate variables from functions, but in Ruby you can't tell by looking whether "photos" is a variable or a method. In your case the interpreter guessed wrong -- which only made the error more cryptic.
Back to "Sanity Checking for Scripting Languages"
Design Element

Copyright © Scott Stevenson 2004-2015