On 22 August 2011 17:57, Angus Croll <[email protected]> wrote: > Nick, more power to you for experimenting with eval. Blanket rejection of > "bad practices" makes the language go stale. Understanding the risks and > using a feature judiciously is a better approach (I'm sure there was a time > when folks shook their heads at self-invoking functions too). > I like Resig's take on eval: > > "Overwhelmingly [eval is] trivailized, misused, and outright condemned by > most JavaScript programmers but by looking at the work of some of the best > coders you can see that , when used appropriately [it] allows for the > creation of some fantastic pieces of code that wouldn’t be possible > otherwise" > (Having said all that, in your example I would just test for a namespace > like DEBUG and if its there, assign the private vars as properties of it. > But hey this is an experiment - so go for it) >
Thanks for the kind words :) Another thought I had was keeping all the private vars as properties of a private object, and revealing that during debugging if necessary. Which is basically the same idea as yours. Anyway, yeah, viva la experimentation! -- Nick Morgan http://skilldrick.co.uk @skilldrick Save our in-boxes! http://emailcharter.org -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
