Thread: OO initiative.
View Single Post
11-29-05, 10:18 PM   #33
Esamynn
Featured Artist
Premium Member
Featured
Join Date: Jan 2005
Posts: 395
Originally Posted by Rowne
In fact, if you do a search on namespace pollution via Google, you'll find that every site that talks about it says that it's a bad thing and that we should avoid dropping loads of global footprints there for one piece of code. Even Programming in Lua, the official book on Lua programming, advises that we not do it.

The only reason I could imagine that everyone would be so steadfastly against pollution is that by polluting the namespace, it'll lead to detrimental effects on the Lua environment. What those are exactly I'd have to research but I wouldn't want to force the issue by finding out through experience.
I would be interested to find out if pollution of the global namespace has any downsides other than the potential for collisions. I have always used the underscore character in my global function, variable and frame names to simulate OOP in spirit, and I have been unable to ponder out any reason as why this is not just as good as true Lua OOP.
  Reply With Quote