Live data from Hacker News

React is the new jQuery

bradfrost.com

61–70 of 206 posts

Re: React is the new jQuery

#61
I like to shit on jQuery like anybody else, but it did have its place in the world. It was totally abused by people, but that doesn't make jQuery bad per se, any more than PHP or JavaScript is bad. Yes, I avoided using those things as much as I could, and I much prefer other tools, but they are tools nonetheless. Bad programmers and nontechnical people posing as programmers can abuse well-loved and efficient tools, too. Have you ever seen code written by a noob embedded "engineer" who decided to write their weekend side project in Golang? It's as much a fucking disaster as any of the bad PHP or jQuery stuff out there.

Re: React is the new jQuery

#62

Sort of tangential, but React is way less painful with TypeScript/tsx. I combine that with an IntelliJ IDE (RubyMine specifically) and honestly, it's a lot of fun to write web apps this way. (Maybe that's because I come from an iOS background?) Anyway, I recommend giving this setup a go.

My first foray into React was done using Typesctipt. The functional nature of React plays very very with the static typing of TypeScript.

Re: React is the new jQuery

#63

Earlier quoted context omitted.

I don't think JQuery ever got bad. It just got unnecessary, like you said. But it took a lot of work to convince people that it was unnecessary. A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. The other comparative downside of JQuery was that components started to rely on it as a share…

> A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. That's fair. > The other comparative downside of JQuery was that components started to rely on it as a shared library, which meant developers suddenly needed to do dependency management. That is (usually) a bad idea. React absolutely do…

> Who is going to want to use a dropdown component that has the entire React 15.3 lib bundled into it?

And who would want a dropdown component that has its own little rendering framework inside when you are using React for that?

Re: React is the new jQuery

#64

Earlier quoted context omitted.

I don't think JQuery ever got bad. It just got unnecessary, like you said. But it took a lot of work to convince people that it was unnecessary. A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. The other comparative downside of JQuery was that components started to rely on it as a share…

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.

Re: React is the new jQuery

#66

> 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…

Well kids these days. They said webkit is the new IE, and said the IE era was IE7. Sigh

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

Despite Web development as a whole, back end or front end is still no where near being good enough, it is still many times better then the old days.

Re: React is the new jQuery

#67

Earlier quoted context omitted.

I don't think JQuery ever got bad. It just got unnecessary, like you said. But it took a lot of work to convince people that it was unnecessary. A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. The other comparative downside of JQuery was that components started to rely on it as a share…

> A charitable explanation of Sara's tweet might be that, like with jQuery, it is becoming difficult to convince new developers that React may not be necessary for their next project. That's fair. > The other comparative downside of JQuery was that components started to rely on it as a shared library, which meant developers suddenly needed to do dependency management. That is (usually) a bad idea. React absolutely do…

To clarify what I was talking about with dependencies, many jQuery widgets used jQuery as a global dependency. This is very different from just building a bloated library - I might prefer a small library that has fewer dependencies for performance reasons, but I can still use a large one without any engineering downsides.

The problem is if I need to manage the dependencies between multiple components - if there's a singleton dependency that multiple components are accessing. It's dangerous not because it's a dependency, but because the components consuming it may have different requirements or assumptions that conflict with each other, and I won't be able to fix those assumptions without forking the components.

This is where you would run into scenarios where somebody's widget was only jQuery 2.x compatible, and somebody else's wanted to add custom events that interfered with scroll direction or something... I still have horror stories about trying to debug that kind of crap.

Shared dependencies really seem like they should be a good idea, but unless you're willing to fork other people's code or your app is only going to have a very short lifespan they're usually more trouble then they're worth.

To be fair, I think jQuery eventually did go the same way as Lodash. I haven't checked in a while but I'm pretty sure that they now have a way to generate a custom build of jQuery to be locally scoped to whatever thing you're building.

It would be tough for Vue to go the same route (still much easier than React) but that just means that you should probably only use Vue for your own projects and should avoid importing 3rd-party components that rely on having it globally accessible.

Re: React is the new jQuery

#68
I find myself defending myself a lot these days here. I use vanilla js. Never had any trouble, I literally have no bundle, no dependencies, the amount of code I have to write is basically the same either way, no trouble syncing state with DOM either. Have done so in two moderate projects (40k, 15k). Everyone I meet looks at me like I'm crazy. But in the same breadth say the site feels so smooth and responsive. No shit.

Catch being you he to learn how to write js but that's true for any framework as well. And frameworks have smaller shelf life anyways.

Re: React is the new jQuery

#69

> 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…

jQuery was never bad. As a tool it was fantastic at what it did.

But jQuery wasn’t just a tool, it was also community. What that community did/perpetuated was some pretty bad and ill advised practices. Plugins for everything - the old $.sum(2,2) joke applies here. DOM for state. Even sanctioned projects like jQuery UI were guilty of some terrible, awful practices.

That said, React isn’t the new jQuery, it’s the new Backbone. Backbone lacked so much - and did so little - that it’s deficiencies needed to be made up for by “other” tooling. As a result, there was O(n) ways to “Backbone” – making backbone apps very difficult to study/build/maintain.

React is fine. The community just needs to coalesce.

Edit: typing on my phone; and am lazy

Re: React is the new jQuery

#70

I think people got carried away with the JSX side of React (which IMO is really just the icing on the cake) and forgot that React was probably the first view library that introduces the notion of the DOM as a pure function of data. It made functional programming mainstream in front-end development. This purity makes UI extremely easy to reason about and makes all DOM changes tractable. I was in a Backbone shop before…

Its funny because JSX is totally unrelated to React besides just being a heavy convention. You can use a totally different template system if you plumb it up correctly. Plus JSX can be used outside of React.

You hit on the two points that makes React what it is. A pure state -> ui abstraction and the ability for large projects or teams to use it efficiently.

Post reply on HN