The warnings generated with the -w flag are rather "paranoid". I
expect that nearly 100% of Ruby code (rubygems, rails, many , etc) in
the wild would generate multiple such warnings, especially the warning
for accessing an undefined instance variable. It is *extremely* common
in Ruby to take advantage of the behavior of undefined instance
variables (that they return nil).

There are other warnings, like for instance the warning you get when
you try to redefine a constant, that are displayed whether the code is
run in -w mode or not. These are the warnings that should be avoided.

On Thu, Oct 15, 2009 at 9:50 AM, Robin Bowes <[email protected]> wrote:
>
> On 14/10/09 22:51, Luke Kanies wrote:
>>
>> I personally disagree that these idioms qualify as code smell, since I
>> use them to avoid a warning (ruby -w is essentially entirely useless
>> if you don't tend to use this idiom).
>>
>> I appear to be "unanimously" overridden, though, so I'll bow out of
>> that part of the discussion.
>
> I don't really know ruby, but if it's anything like perl (I have a perl
> background) then warnings are very useful.
>
> It's accepted PBP [1] to run all code with warnings enabled and to write
> your code so that it doesn't generate warnings.
>
> Perhaps ruby is different? If it is, then I'm not qualified to speak
> about this. If not, I agree with Luke.
>
> R.
>
> [1] perl best practice
>
> >
>



-- 
Rein Henrichs
http://reductivelabs.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to