Live data from Hacker News

React is the new jQuery

bradfrost.com

1–10 of 206 posts

Re: React is the new jQuery

#2
Let’s not forget that jQuery was a polyfill that allowed JavaScript Devs on all browsers to code to a common baseline. React is a nice —- and popular —- library for building UIs but it’s existence isn’t an indictment of the laziness of standards implementors for browsers (okay, IE mainly) and god-send to developers like jQuery was.

Re: React is the new jQuery

#3

Let’s not forget that jQuery was a polyfill that allowed JavaScript Devs on all browsers to code to a common baseline. React is a nice —- and popular —- library for building UIs but it’s existence isn’t an indictment of the laziness of standards implementors for browsers (okay, IE mainly) and god-send to developers like jQuery was.

Yes, React isn’t _exactly_ jQuery, but it gives the same level of productivity boost comparing to development with just the modern DOM APIs (querySelector, classList, etc).

Re: React is the new jQuery

#4
Oh Brad, you do not know what you are talking about right off the bat. Let's go through your list.

1. Every document has a root node. is your root node now. You had a root node before, you have a root node now.

2. Do a search and replace. That's easy.

3. That's another search and replace.

4. You don't need to call a constructor, you don't need to use bind, and you don't need to assign your functions to an variable on your class instance.

React allows you to compose things. Make something once and use it everywhere. You write much, much less code. You get lifecycle hooks for when things mount, update, unmount. You get easy templating in JSX. You can also ditch the whole thing for Inferno if you care about having no lisence or company behind it.

You also get amazing libraries for state management and async via reactivex.

Re: React is the new jQuery

#5

Oh Brad, you do not know what you are talking about right off the bat. Let's go through your list. 1. Every document has a root node. is your root node now. You had a root node before, you have a root node now. 2. Do a search and replace. That's easy. 3. That's another search and replace. 4. You don't need to call a constructor, you don't need to use bind, and you don't need to assign your functions to an variable on…

You also get convention. jQuery didn't offer much of that once you started gluing its functions together...

I can usually jump into someone's react code and get what's going on pretty quickly unless they did something really gnarly with incredibly nested props. Even then, at least I still know where to drill down. With jQuery soup, you didn't get that luxury.

Being able to have an entire team know how to build components and provide them with functionality is an incredible advantage. I don't love everything about react either, but the ecosystem, somewhat enforced convention, tooling, etc - it's worth it (so far).

I love some things about Vue, but it isn't a silver bullet either. Brad seems to be pretty butt hurt about react. If you've worked on a large team without something like react, then worked on one with react, it really shines. It's a major productivity booster.

It's not perfect, but it's very good.

Re: React is the new jQuery

#6
We're talking about two totally different programming paradigms here. The end product might be the same but it's more of a question about how you arrive there.

With JQuery you're signing up for manual DOM manipulation. It's a challenge to scale that for what's now considered table-stakes for web apps.

Re: React is the new jQuery

#7

Oh Brad, you do not know what you are talking about right off the bat. Let's go through your list. 1. Every document has a root node. is your root node now. You had a root node before, you have a root node now. 2. Do a search and replace. That's easy. 3. That's another search and replace. 4. You don't need to call a constructor, you don't need to use bind, and you don't need to assign your functions to an variable on…

You also get convention. jQuery didn't offer much of that once you started gluing its functions together... I can usually jump into someone's react code and get what's going on pretty quickly unless they did something really gnarly with incredibly nested props. Even then, at least I still know where to drill down. With jQuery soup, you didn't get that luxury. Being able to have an entire team know how to build compon…

jQuery had a lot of convention, for both it and it's plugins.

jQuery + co. have very consistent "look and feel"

Re: React is the new jQuery

#8

Earlier quoted context omitted.

You also get convention. jQuery didn't offer much of that once you started gluing its functions together... I can usually jump into someone's react code and get what's going on pretty quickly unless they did something really gnarly with incredibly nested props. Even then, at least I still know where to drill down. With jQuery soup, you didn't get that luxury. Being able to have an entire team know how to build compon…

jQuery had a lot of convention, for both it and it's plugins. jQuery + co. have very consistent "look and feel"

I agree when you’re talking about the most well known of plugins and so on, but IME for application code all that goes out the window. A lot of developers really didn’t know how to write JavaScript back then. Still don’t, but we didn’t then either ;)

Re: React is the new jQuery

#9
If you tear out something like jQuery, you’re going to have to figure out a way to get those accordions to expand and collapse again. If you tear out React, you get a blank page. React is a big commitment.

This is probably the only real concern I see.

jQuery is a library for DOM manipulation. It can co-exist with many other libraries.

React is an entire framework.

These days you need jquery less because browsers are more standards compliant and css animations basically work.

The trick is about using the right tool for the right job.

We have several large react applications - these are user-interaction heavy rich single page apps.

But we also use vanilla html and jquery dom manipulations in many other places.

Post reply on HN