"Aaron Hinni" <aaron / hinnispace.com> wrote in message news:<BC5E676A9142D411A4520008C7E6E89AB1B6C7 / mail.paylinx.com>...
> > Since Ruby does not require a variable to be declared, do people find
> > that they often have bugs related to mistyping variable names?
> > Now that I am starting in Ruby, I am wondering what others
> > have done to avoid the problem.
> 
> These sorts of problems happen less often than you might think.  When they
> do happen, the trick is to catch them as early as possible.  I do this by
> writing unit tests for all of the code I write.
> 

I am sure unit testing, especially with a dedicated framework, goes a
long way to finding any such mistakes.  However, the test merely
reveals that there is a problem, not what the exact problem is.  I
find, for me at least, these bugs very hard to see.  My eyes are
tricked into seeing the code I *meant* to type, not the code I *did*
type.

Has someone already made a "lint" for Ruby? If such a tool could warn
about "initialized, but never used" variables, it would help find some
of these kind of mistakes. I would even make one unit test require "no
lint warnings" as part of the test suite.

But I wonder the same as Dave, does this really come up that much? 
Would others like to tell if this happens to them?  Is it a problem
for anyone?

Regards,
Nick