5 ms·
There's a lot of choices, and that's not a bad thing necessarily. Javascript is in a heavy growth period right now. But I totally get the choice overload thing.
by TheZenPsycho 13y ago
There's a lot of choices, and that's not a bad thing necessarily. Javascript is in a heavy growth period right now. But I totally get the choice overload thing. There's a lot of people interested in javascript from all different areas of computer land, and they all have different ideas of what "best" is, and they all want to make javascript more like lisp, or more like ruby, or more like java, or more like c# or more like flash, and so on and so forth.
If you just need a choice, somewhere to start. I'll make some choices for you. Here's the zen selection. My view of the standard javascript library:
jquery ($)
underscore (_)
mustache ({{}}) (possibly accentuated by iCanHaz)
Backbone (Backbone)
And that's your basic starter pack.
It's a confused ecosystem because it was only since about 2007 that people started to realise that javascript was an actual programming language and not just a stupid toy. I remember that year chatting with people on #javascript on IRC who simply didn't believe that I had an actual full time job writing server side javascript. the idea seemed too absurd. And so here we are, a mere 7 years later and we've pieced together a very humble ecosystem in the face of that level of bald hatred and misunderstanding. I remember it wasn't so long ago that flash was in a similar position, and not long before that, java, with its popular image being its slow crummy applets.
So, yes, in conclusion, you're right, and it's because it's young and every language goes through this stage.
- acjohnson55 13y agoIs there any strong reason to use Underscore over Lodash?
- SiVal 13y agoIs there a good, focused, website where these .js tools are discussed on an ongoing basis? Yes, I know HN and a thousand other places scattered all over, and maybe that's really all there is, but I'm hoping there's a way to figure out what .js tools ought to be used for what, and keep abreast of changes, without having to read the whole Internet. I suppose I could ask experienced developers on StackOverflow.... (Just kidding! "Stop! Silence! Nobody answer him! Not constructive! Not Constructive!")
- jffry 13y agoBackbone may or may not be right for you. Fortunately it's small, and fairly easy to read. The annotated sources [1][2] for BackBone and Underscore are fairly accessible. Also, I would highly recommend adding an AMD loader like require.js to your "basics kit". Code organization gets very important very fast, and it helps to think modular-and-reusable from the beginning. [1] http://underscorejs.org/docs/underscore.html http://underscorejs.org/docs/underscore.html [2] http://backbonejs.org/docs/backbone.html http://backbonejs.org/docs/backbone.html
- vonseel 13y agoFor someone new to JS, as I once was, Require.JS can really complicate things. I know I read all these comments and blog posts saying "Use require.js!", so I thought I had to use it. Well, it took a long time to figure out how to structure my Backbone code that way. Most examples and tutorials aren't using Require.JS, and that also makes things harder. I would use it now on a backbone project, but not sure if I would recommend it to beginners.
- SkyMarshal 13y agoPlenty of debate these days over whether to use an AMD-based loaders like require.js [1], or to bundle all your js into a single file with Browserify [2]. Worth someone new being aware of, but that debate can get rather complicated. [1]:http://requirejs.org/ http://requirejs.org/ [2]:http://browserify.org/ http://browserify.org/
- jasonlotito 13y agoJust a heads up, but require.js supports moving everything into a single file: http://requirejs.org/docs/optimization.html http://requirejs.org/docs/optimization.html Your comment makes it seem like it doesn't.
- clavalle 13y agoAll of you are giving good advice but I just have to chuckle at how quickly you all proved OPs point.
- sjs382 13y agoAnd definitely replace jQuery with Zepto (which is more-or-less a drop-in replacement), if you have control of the client (non-IE) or especially are working in mobile.
- mcdougle 13y agoI've not heard of Zepto. Out of curiosity, why use it over jQuery?
- sjs382 13y agoWhen using Phonegap (and mobile web in general), I've experienced a pretty major delay between page load and jQuery running. Zepto seems to run instantly. YMMV.
- deleted 13y ago[deleted]
- SkyMarshal 13y agoIt's minimalist. http://zeptojs.com/ http://zeptojs.com/
- sehr 13y agoProbably the file size argument, last time I read one of these discussions jQuery was 3x bigger gzipped at ~30kb.
- mcdougle 13y agoOk, that makes sense, especially for mobile development. I looked it up, and it seems to be missing quite a bit, including the .noConflict() option, which I seem to have to use quite a bit when working on others' code....
- SkyMarshal 13y agoI wouldn't say "definitely". Even Foundation has gone back to jQuery.
- test1235 13y agoIf you're starting out from new, I'd argue you can make do with the templating in underscore instead of adding another library. http://underscorejs.org/#template http://underscorejs.org/#template
- dmragone 13y agoIf front-end MVC Is too much for a given use case, then Twitter's Flight.js[1] seems like a great way to keep jQuery well organized. It defines a way to write jQuery components that communicate via events, piggy-backing on the DOM's event propagation. Quite simple, and ideal for when a single-page-app (e.g. the kind you get with Backbone) isn't quite right for you. [1] http://flightjs.github.io/ http://flightjs.github.io/