From: Christian Szegedy Date: 2002-09-17T02:31:33+09:00 Subject: Re: private variables Paul Brannan wrote: > On Mon, Sep 16, 2002 at 11:50:54PM +0900, Christian Szegedy wrote: > >>Private methods and class-local instance variables are quite different. >>If you use a private method, you get an exception. If you try to use >>a class-local instance variable then you just use another variable, >>which could lead to obscure bugs. >>So I think punctuation (and it should be as short as possible) >>is a much better option. > > > If you try to use a class-local instance variable and it has not yet > been initialized, I would expect to see a warning when you run with ruby > -w, just like you get now with regular instance variables. > > Paul > I often initialize instance variables conditionally. (That is, on first use).