Live data from Hacker News

React is the new jQuery

bradfrost.com

141–150 of 206 posts

Re: React is the new jQuery

#141
Nitpicks aside, it seems to me that React/Vue are only/mainly useful for two-way data binding. If it's just one-way binding (i.e. JSON to template), then jQuery with something like Handlebars will be just fine. Correct me if I've misunderstood.

Re: React is the new jQuery

#142

Earlier quoted context omitted.

Es2018 all the way. Web workers, classes, Isomorphic code, generators, async await, etc with a splash of Babel Devs have never been happier. Everything just works and online documentation is Rich and plentiful. Plus as I said, core logic works on both server and client and we have offline support as an added bonus.

No bundle but you use Babel? How does that work?

Babelified code sits in another directory, I hotswap it if I think they are not on a modern browser (IE or older version of mordern browsers). So any normal Joe using chrome or ff or edge will not get a bundle. But if I'm not sure, the backwards compatible version is sent instead. So I think I can claim that there's no bundle since most of my users don't get one.

Re: React is the new jQuery

#143

Earlier quoted context omitted.

>cant even name a similar piece of software in web development history that is as important as jQuery. Php?

Nah, there were always tons of alternatives to PHP. What real alternatives were there to jQuery? There were none.

Javascript is irreplaceable to the web

Re: React is the new jQuery

#144

> React is the new jQuery Anyone who uses "the new jQuery" as some sort of insult (as it seems Sara did in her tweet) probably hasn't been a developer for more than a few years or is just trying to sound smarter than they are by bashing an easy target. The reason jQuery got so popular is that it made common tasks so much easier than anything else at the time. Anyone who was doing web development before jQuery knows w…

Insulting is really what i felt too. Simplicity, size, ubiquity, plug and play are the opposite of react.

I would understand if comparing VueJS with jquey. Even if they are very different, the philosophy is the same: a small elegant easy to use versatil tool.

Re: React is the new jQuery

#145

I am learning to code and a newbe. I think jQuery != react. I do not understand, why experienced people like to compare jQuery with react when both the lib have different goal ? And show that jQuery is bad. React can be used with jQuery for DOM manipulation. Described in react doc ( https://reactjs.org/docs/integrating-with-other-libraries.ht... ). Shall I learn jQuery at all ? Please, guide me.

The comparison Sara made was that React can be overused just as jQuery was.

The problems with jQuery is that it's mostly a set of functions to simplify Ajax and DOM manipulation so it's not really helpful for the structure of an application.

React (and other frameworks surch as Angular, Ember and Vue), on the other hand, helps you to build reusable component which helps a lot to scale.

Also jQuery's golden age was when browser compatibility was a big issue, nowaday, most browsers behave properly.

There's no harm in learning jQuery, its interface is way more intuitive than native DOM apis. It could be a good idea to try and build a simple app with jQuery and see what are the pain points and then compare with a modern framework.

Re: React is the new jQuery

#146
post #141

Nitpicks aside, it seems to me that React/Vue are only/mainly useful for two-way data binding. If it's just one-way binding (i.e. JSON to template), then jQuery with something like Handlebars will be just fine. Correct me if I've misunderstood.

React and Vue are immediate mode/declarative UI libs. Your code says "given the model/state, here's what I'd like the UI to look like right now", and they manage to mutate the DOM efficiently to achieve what you want.

jQuery and the plain DOM are retained mode APIs. You manipulate stateful objects to achieve your goals. It is ok for simple interactions, but it quickly becomes unmanageable for more complex apps.

Re: React is the new jQuery

#147

Earlier quoted context omitted.

> I cant even name a similar piece of software in web development history that is as important as jQuery. Apache?

There were other web servers, there weren't other jQuerys.

I get the point you're mentioning but jQuery was there with Prototype.js and Mootools.

Re: React is the new jQuery

#148
post #127
post #86

When I see this: var formname = $(this).find('.formname'); formname.empty(); formname.append(n_input); I think why not just use plain Javascript and do this: document.querySelector('.formname').innerHTML=n_input; Coders that are attached to libraries and frameworks always seem so afraid to use the tech already available. That they don't even look at how the basic solution would look like.

Sorry for being terribly pedantic, but the "vanilla" version just does not do what the jQuery code does: - `this` might not be document - find might return multiple elements, not just one - if nothing matches, jQuery does not throw unlike the vanilla version I do understand it's just an example, but if you'd consider all the implicit cases the jQuery example covers, you'd end up with a lot more than a single line. I…

These seem to be unintended side effects. From the example it seems the vanilla versions behaviour is what the author wants.

Re: React is the new jQuery

#149
post #64

Earlier quoted context omitted.

Being used to jQuery, I really see no reason not to use it in new projects. I could learn all the new native equivalents, and even then still ending up doing more work than if I'd been using jQuery, just to save a little bit of page load time and filesize, but it would almost certainly not be worth it.

It irks me that Javascript didn't just adopt the best parts of JQuery.

There are still things you can only do with jQuery, I can't think of a better Swiss Army knife for small tasks.

Re: React is the new jQuery

#150
Since early in my career when hiring I've found developers who only know 'jQuery / Angular / Vue / React' but not the underlying Javascript, I swear "x is the new y" is said every time a new framework gets 6 months into vogue.
Post reply on HN