Relative Content

Tag Archive for globals

Why create a Global-ish Object.create function?

I’m a fairly experienced programmer in the .NET and Java realms, and I’ve started reading up on JavaScript. I bought Douglas Crockford’s “The Good Parts” book, and I’m immediately put off by a few things.

Should I use a global logging variable?

Over and over again we’re told, “globals are bad” and with good reason. However, I’m working with a logger that needs to be accessible everywhere in the program. Why shouldn’t I create a global logging object? The alternative seems to be to pass the logger object into every object I instantiate and that seems very repetitive and non-productive.