From: Daniel Berger Date: 2007-12-09T23:40:05+09:00 Subject: Re: How much would variable declarations in Ruby make you wince? On Dec 9, 3:27 am, "Tim Uckun" wrote: > > A solution to my problem would be to require variable declarations. > > Something like the "my" keyword of a strict PERL script. Ruby would > > probably not use "my," despite its PERL roots. Maybe "var?" > > I think it would be useful especially for people coming to ruby from > non case sensitive languages. I certainly don't see any harm in > setting up something like strict. If you don't want to use it you > don't have to. Once you make something like that optional it has a way of becoming mandatory in a cultural sense. Go ahead, write a Perl program without strict and try to get Perl community support. You'll be berated (and probably insulted) within 2 seconds. No, the solution is to stop writing monolithic top-down scripts where you can trip yourself up with such a mistake and/or write tests that would catch something so simple anyway. In all the years I've programmed in Ruby I have never been bitten by the lack of strict variable declaration. Where it *can* be an issue is with instance variables. However, those are easily smoked out when you run with -w. You *do* run your tests with warnings on, right. Yes, of course you do. :) Regards, Dan PS - I've suggested to Jim that warnings be turned on by default for test tasks in Rake.