lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> AdL> You can call that personal taste. Having to explicitly inform the
> AdL> scope of the variables I'm reading from/writing to is just an
> waste 
> AdL> of key hits. But that's just my point of view, and I'll try to
> AdL> address it with setfenv like Adam suggested, at least until I can
> AdL> find another language that has most nice features of Lua (maily
> AdL> small size and easy to embed)
> AdL> *and* is OO.
> 
> I feel this OO business gets way too much attention. Nonetheless,
> here we go: I absolutely hate the C++ way of implicit scopes. It may
> save a few keypresses when writing it, but it is a nightmare when
> trying to understand other peoples code. Plus, it twists the
> semantics (from looking at a statement, you can not tell wether any
> variables referenced are members of some current object, or variables
> within the current scope), and breaks lexical scoping. Looking at
> this sort of issues, and also what C++ people do with operator
> overloading, I tend to think that they have a knack for puzzles.     

I don't like (and don't know) C++ either, but assuming that the current
instance inside a given method is called "this", you could type this.foo
and this.bar throughout the method's body if you like. For me it's what
I said, a waste of keyhits and of time trying to catch bugs when members
are being looked at the globals table.

Regards,

Andre de Leiradella