recipeswithbackbone / recipeswithbackbone.github.com

Marketing site for the best damn backbone.js book evar
23 stars 1 forks source link

"Namespacing" is confusing #5

Closed ngauthier closed 12 years ago

ngauthier commented 12 years ago

from a reader:

"- p 8: This is confusing. Are you recommending that people use function namespacing for large apps, then also recommending that they put all that code in the same file? Properly organizing code into separate files is an even bigger problem than encapsulating code into a logical namespace."

chrislawlor commented 12 years ago

+1 - I was wondering the same thing. Seems that in trying to solve one problem, you are creating a worse one. Maybe this is just a perceived problem, and isn't really an issue in practice?

eee-c commented 12 years ago

I've been doing mid-sized apps (~500 loc) in a single file. With effective use of hide-show modes, it really hasn't bothered me that much.

Still, it's a valid point. Ultimately, I'll prolly rework slightly to offer the constructor namespacing as an initial approach, but one that won't scale for most people.

I'm not a fan of require.js and the like, so I think we're stuck with some variation of what's already in the recipe.

eee-c commented 12 years ago

I ended up leaving this mostly as-is. I did soften my "recommended" stance and made both more a personal choice thing. I'm going to see if I can figure out this requirejs stuff as a possible alternative for 1.1. But that's already a separate issue.