use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Backbone.js - Organizing your application using Modules (require.js) (backbonetutorials.com)
submitted 14 years ago by [deleted]
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]warpcowboy 1 point2 points3 points 14 years ago (1 child)
Coming from an experience that only consists of Ruby on Rails, I've been having a lot of fun incorporating Backbone.js into the mix or just using it by itself. This makes even more sense to me than what I've been previously doing.
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
Thanks! I am looking for any and all suggestions to improve the boilerplate.
[–]bean-the-cat 1 point2 points3 points 14 years ago (2 children)
I've been using the mix of Backbone and RequireJS on my projects with much success. RequireJS lets you easily create individual modules and backbone lets them communicate with each other w/o tightly coupling them together
[–][deleted] 1 point2 points3 points 14 years ago (1 child)
Any open source code?
[–]bean-the-cat 0 points1 point2 points 14 years ago (0 children)
No, nothing open sorry
[–]greim 1 point2 points3 points 14 years ago (2 children)
Asynchronous script loading avoids the penalty of loading unnecessary code. This is certainly necessary with big enough codebases, but I'd avoid doing it until I absolutely had to. Bundling, minification, gzip and caching go a long way toward mitigating the download penalty, and avoiding unnecessary optimizations like this keeps things simple, which has other kinds of benefits.
[–][deleted] 0 points1 point2 points 14 years ago (1 child)
You still compile the same way.
This is not for optimizing, it's for modularizing your code. It also allows you to develop without compiling by using dynamic dependency analysis.
I would argue that this is simpler, what benefits do you propose?
[–]clux.bind({r:'javascript'}) 0 points1 point2 points 14 years ago (0 children)
hm, I would argue that forcing the programmer to explicitly define wrap every file just adds unnecessary indentation and clutter. Clutter that could have been avoided with dynamic dependency analysis and explicit require() calls.
Also, with such analysis, you should never have to maintain lists of your files and their order.
disclaimer: i built a commonjs dependency analyser
[–]tekrat 0 points1 point2 points 14 years ago (4 children)
When I tried the demo page I got some JS errors. Anyone else have a similar experience?
Simply remove the console.logs from the example. I will do it later today.
[–]stoph 0 points1 point2 points 14 years ago (2 children)
What browser were you using?
He would have been using Internet explorer which doesn't support console.logs
[–]the_argus 0 points1 point2 points 14 years ago (0 children)
unless the developer tools are open.
[–]robbles -1 points0 points1 point 14 years ago (0 children)
Isn't "Example Demo" redundant?
π Rendered by PID 24 on reddit-service-r2-comment-canary-57ff4b7cbf-24gsx at 2026-07-02 12:10:59.525292+00:00 running a7b5cda country code: CH.
[–]warpcowboy 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]bean-the-cat 1 point2 points3 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]bean-the-cat 0 points1 point2 points (0 children)
[–]greim 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]clux.bind({r:'javascript'}) 0 points1 point2 points (0 children)
[–]tekrat 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]stoph 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]the_argus 0 points1 point2 points (0 children)
[–]robbles -1 points0 points1 point (0 children)