4 ms·
I'm a self taught JS coder and I've used Jquery to make basic single page applications with waypoints and scroll to load using a server based REST API and JSON
by INTPenis 14y ago
I'm a self taught JS coder and I've used Jquery to make basic single page applications with waypoints and scroll to load using a server based REST API and JSON to communicate with it.
My question to the community in this thread is, why all these new JS libraries? Do they offer something that I don't know about, something jquery doesn't?
He didn't even mention jquery in his post, yet he mentioned a ton of other libraries I had never heard of before. So I'm very curious.
- Joeri 14y agoJquery has no native mechanism of doing MVC. Building a page with a few sets of interactive elements using jquery is perfectly fine, but scaling it up to a hundred screens all packed into a single page is essentially impossible.
- charlieflowers 14y agoWhen the logic and interactivity of your page grows, you reach a point where it is really hard to maintain it all with just jQuery. You'll be firing events, and listening for them, and tracking a lot of state that could become global if you don't fight against that really hard. If the state does become global, then you will have all the struggles that come with that ... something will change "foo" in the global state, and that will cause problems in some completely unrelated part of the page, which will take you hours/days to track down. This is just one example of the kind of problem you can experience. What the Single Page App frameworks offer is a nicer way to organize all this complexity. You have models, which can fire events. You have Controllers, which (though defined differently in each framework) help you capture and express event listeners in one well-managed location. And you have views to generate changes to the HTML, which usually have enough integration with the models that it greatly reduces the amount of event handling/template re-generation code you have to write. They really do make a difference, and the MVC frameworks that are out there these days are excellent. I guess the only real way to get a handle on what they do for you is to try a quick demo.
- ch0wn 14y agohttp://todomvc.com http://todomvc.com can give you an answer to this question. It implements the same Todo app in a variety of different frameworks and has a jQuery implementation to compare against. The differences become very obvious in this case.