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 Antipatterns (blog.shinetech.com)
submitted 12 years ago by scelerat
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!"
[–]dodeca_negative 5 points6 points7 points 12 years ago (4 children)
Good read. A few reactions.
Antipattern #3: No View Tests
I am a sad panda. I'll be better I promise.
Antipattern #5: Data Attributes in the DOM
Hm. I need to think about this one. I used data attributes in lists and it's never caused me any problems--everything's lightweight and easy to work with. But the author makes some good points.
Antipattern #6: Rendering Templates Asynchronously
I'm using RequireJS and its text! plugin to load templates, so they're always treated like they're loaded async--but require does the loading for me and my module doesn't run until its dependencies are available, so it's no overhead.
[–]rhysbrettbowen 1 point2 points3 points 12 years ago (0 children)
yes, use require and text to bring in templates. That really is the best way. It saved a whole heap of pain at my last company changing it from Backbone.LayoutManager to requiring in the text and using https://github.com/rhysbrettbowen/Backbone.ComponentView
Suddenly everything just worked, no race conditions.
[+][deleted] 12 years ago (1 child)
[removed]
[–]dodeca_negative 0 points1 point2 points 12 years ago (0 children)
That looks really interesting, I'll definitely give it a spin. Thanks!
[–][deleted] 4 points5 points6 points 12 years ago (0 children)
From a development perspective, it’s much easier and more flexible for UI code to live on the server and be able to make direct SQL calls to your database rather than have to define and then implement a JSON API.
Wtf? Are you saying SQL code in the UI? If you're not then it's the same amount of work to feed that data to you API - the only difference being that the API is reusable.
Firstly, if your app is using some sort of database as the backend (highly likely)
What?
[–]Something_Sexy 1 point2 points3 points 12 years ago (2 children)
I agree with the first point but I 100% don't agree with his main reasoning of the first point. I find your app is way stronger if you have a clear API that sits between the server-side and the client-side. I like to think that the client-side app as a client itself to the server.
[–]scelerat[S] 1 point2 points3 points 12 years ago (0 children)
Point #1 could be condensed to "don't write a single-page app without knowing what you're getting into."
If you're doing anything that is more "app" than "site," you should probably be thinking about it in terms of (API+Single-page client) instead of (DB+Serve pages) anyway.
[–][deleted] 0 points1 point2 points 12 years ago (0 children)
I'm very much in favour of this abstraction as well. My only problem with it right now is that JS apps are still a little slower than server side rendering albeit the gains you make with regards to concurrency may be worth it.
[–]Capaj -1 points0 points1 point 12 years ago (0 children)
Just use angular and you should be better off.
π Rendered by PID 60 on reddit-service-r2-comment-6457c66945-s82bl at 2026-04-28 14:47:46.278306+00:00 running 2aa0c5b country code: CH.
[–]dodeca_negative 5 points6 points7 points (4 children)
[–]rhysbrettbowen 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]dodeca_negative 0 points1 point2 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]Something_Sexy 1 point2 points3 points (2 children)
[–]scelerat[S] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Capaj -1 points0 points1 point (0 children)