TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing the Backbone.js Boilerplate

222 pointsby wesbosover 13 years ago

12 comments

kragenover 13 years ago
"Boilerplate", as I understand it, is text you copy and paste, and then edit to your needs. But the name of the game in programming is "don't repeat yourself", that is, don't copy and paste text. (And "eliminate dependencies," but that doesn't come into play here.)<p>So, in programming, boilerplate is always bad. Boilerplate is the enemy. Boilerplate is what makes software unmaintainable. Boilerplate multiplies bugs. Boilerplate is not a "best practice". Boilerplate is a worst practice. Boilerplate is not canonical; it is demonical. Boilerplate is the failure to factor your software into reusable subroutines. Boilerplate mixes your green, red, and yellow code all together.<p>This seems to be a combination of a decent development environment (a reasonable selection of libraries: Underscore, jQuery, Backbone, node.js) and 1000+ lines of actual boilerplate.<p>I don't know why people here seem so willing to forgive the use of boilerplate. This post has 193 upvotes as I write this so I guess there are at least 193 non-hackers reading and voting on Hacker News. I hope I never have to fix their code.
评论 #3451657 未加载
评论 #3455271 未加载
评论 #3451887 未加载
评论 #3451727 未加载
tmcwover 13 years ago
Might also want to check out my company's bones framework: <a href="https://github.com/developmentseed/bones" rel="nofollow">https://github.com/developmentseed/bones</a><p>Expressjs + Backbone, with plugins, multi-process servers, settings management, etc. It's used by large applications like our hosting service: <a href="http://tiles.mapbox.com/" rel="nofollow">http://tiles.mapbox.com/</a>
评论 #3451126 未加载
评论 #3449441 未加载
fiznoolover 13 years ago
This looks fantastic, especially with the integration with HTML5BP. Awesome work!<p>Just wondering if you considered using RequireJS instead of namespacing? Backbone plays quite nicely with RequireJS if you use James Burke's version which has been forked to be compatible: <a href="https://github.com/jrburke/backbone/blob/optamd/backbone.js" rel="nofollow">https://github.com/jrburke/backbone/blob/optamd/backbone.js</a><p>More info here: <a href="http://jcreamerlive.com/2011/12/09/backbonejs-modular-app-using-requirejs/" rel="nofollow">http://jcreamerlive.com/2011/12/09/backbonejs-modular-app-us...</a>
评论 #3450508 未加载
jashkenasover 13 years ago
I'd be curious to hear someone from Bocoup describe how this boilerplate fits in when you're already using a web framework.<p>In Rails, or Django, or whatever, wouldn't you want to use the built-in JavaScript folder structure and asset building strategy?
评论 #3450280 未加载
评论 #3448936 未加载
评论 #3449405 未加载
评论 #3451378 未加载
评论 #3449276 未加载
ronreiterover 13 years ago
Here's my boilerplate for GAE + Backbone.js + Require.js, which is very good for large scale Javascript development.<p><a href="https://github.com/ronreiter/webapp-boilerplate" rel="nofollow">https://github.com/ronreiter/webapp-boilerplate</a><p>I've seen your source code, and your build directory makes a lot of sense. I'll add it to my boilerplate as well.<p>Thanks for your code!
评论 #3448942 未加载
samstokesover 13 years ago
Nitpick:<p><i>I recently began to organize this work into a _conical_ boilerplate for Backbone.</i><p>I think you mean "canonical" :)
评论 #3449246 未加载
howardrover 13 years ago
Glad there are people spearheading discussions around backbone project organization.<p>I agree that backbone is very powerful, but talk is just beginning on how to fit it in to current web app projects that don't fit the boostrapped-singled-html page model
评论 #3449597 未加载
iusableover 13 years ago
Without getting into the technicalities of this, I am grateful somebody came up with this. I am working on a backbone + jq + mongo app right now &#38; this might have been useful, at least in the early days.
rralianover 13 years ago
This is really cool. As someone who has only a little experience with backbone, I've really been looking for a more opinionated approach to backbone.
drivebyacct2over 13 years ago
This has been very helpful for me, learning Backbone.js: <a href="http://ricostacruz.com/backbone-patterns/" rel="nofollow">http://ricostacruz.com/backbone-patterns/</a>
jsavimbiover 13 years ago
Hats off to the hard-working Tim Branyen and the rest of the crew at Bocoup. Thanks for sharing!
darylteoover 13 years ago
Commenting so I can look at this later.
评论 #3449842 未加载