cowboy/grunt — Issue #12: Globals considered harmful.
Author: indexzero
Created: 2012-01-23 02:01:55+00:00
State: open

https://github.com/cowboy/grunt/blob/master/lib/grunt.js#L12-29

A set of statements like this is basically telling your users emphatically that "it's all or nothing folks," whereas in node generally many files can be required independently of each other and that's considered a good thing. It also makes the hooks for your application very difficult to reconcile with other approaches. If I want to modify how you log in grunt, I need to modify a global variable and that just seems wrong.

The approach we've taken in `flatiron` is to create an `App` object and pass that app around, attaching functionality along the way through well-defined plugins; basically a feather-weight IoC mechanism.

Would be interested in your thoughts here. I was going to do spec a potential refactor to the flatiron CLI, but these globals were too hard to reconcile with it. I did another one last week: https://github.com/vesln/issues/pull/8

Anyway, neat project though. <3 buildsystems.