IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Ruby question
In perl we 'use strict' to make sure if we typo a variable it doesn't match a declaration and errors out.

Does this exist in Ruby?

The boy is teaching it to himself and I can't help him on this one, I don't see it on a quick lookup.

Thanks
New At least as of 2007, it doesn't seem to be there.
But some of that is by design.

http://groups.google...75a996f183c?pli=1

HTH.

Cheers,
Scott.
New BT's response
============
There is nothing like that built in to Ruby or Python.

But there are lint tools that accomplish the same purpose. A bunch
are listed at http://stackoverflow...int-tool-for-ruby
that you can try. (I don't use Ruby myself.)
============

This gives this snippet:


Welcome to the world of dynamic languages. You gain a tremendous amount of flexibility, but you lose the ability to make static assertions about the code like "all the symbols I've referenced are valid at runtime". It's a tradeoff. That said, I think some of the recent IDEs attempt to identify mistakes like this. You might look into RubyMine or Netbeans. Personally, I agree with a previous commenter that your best bet is unit tests. If you want to be notified of mistakes quickly, use something like Autotest to run your tests constantly.


Ok. I'm starting to get it. I was annoyed, but it makes sense.
     Ruby question - (crazy) - (2)
         At least as of 2007, it doesn't seem to be there. - (Another Scott) - (1)
             BT's response - (crazy)

Anyone for a glass of gloat milk?
52 ms