TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

React is the new jQuery

225 pointsby brennankreimanalmost 7 years ago

46 comments

superfrankalmost 7 years ago
&gt; React is the new jQuery<p>Anyone who uses &quot;the new jQuery&quot; as some sort of insult (as it seems Sara did in her tweet) probably hasn&#x27;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.<p>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 what a godsend it was at the time. JQuery was a fantastic leap forward for development at the time it was released.<p>JQuery didn&#x27;t become bad, the rest of the development world caught up and made it unnecessary.
评论 #17212451 未加载
评论 #17212924 未加载
评论 #17213034 未加载
评论 #17212853 未加载
评论 #17214622 未加载
评论 #17213277 未加载
评论 #17213869 未加载
评论 #17212458 未加载
评论 #17213211 未加载
评论 #17212939 未加载
评论 #17214187 未加载
评论 #17213123 未加载
评论 #17214709 未加载
评论 #17212581 未加载
rich-and-pooralmost 7 years ago
Oh Brad, you do not know what you are talking about right off the bat. Let&#x27;s go through your list.<p>1. Every document has a root node. &lt;div id=&#x27;app&#x27; &#x2F;&gt; is your root node now. You had a root node before, you have a root node now.<p>2. Do a search and replace. That&#x27;s easy.<p>3. That&#x27;s another search and replace.<p>4. You don&#x27;t need to call a constructor, you don&#x27;t need to use bind, and you don&#x27;t need to assign your functions to an variable on your class instance.<p>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.<p>You also get amazing libraries for state management and async via reactivex.
评论 #17213114 未加载
评论 #17212199 未加载
itsangarisalmost 7 years ago
Ok, so Brad is already making sweeping declarations about React, yet less than a month ago he specifically posted about his struggle to learn it: <a href="http:&#x2F;&#x2F;bradfrost.com&#x2F;blog&#x2F;post&#x2F;my-struggle-to-learn-react&#x2F;" rel="nofollow">http:&#x2F;&#x2F;bradfrost.com&#x2F;blog&#x2F;post&#x2F;my-struggle-to-learn-react&#x2F;</a> cool...
评论 #17212961 未加载
评论 #17213158 未加载
gcommeralmost 7 years ago
&gt; Burn all of your markup down to the ground and replace what you had with &lt;div id=&quot;app&quot; &#x2F;&gt;<p>This isn&#x27;t totally true -- if you really only wanted to implement a single toggle and leave the rest of the page alone, then you could replace just the relevant DOM elements with a container and render into that fragment of the page. (Though really I&#x27;d ask why use React if that&#x27;s the only value you&#x27;re getting out of it)<p>&gt; I guess that’s why I’m still struggling to comprehend why so many organizations are so eager to take the sturdy, foundational layer of the frontend stack and rewrite it all in a proprietary format. [...] Projects like Vue are showing that’s not necessary.<p>Except, Vue.js does require a proprietary format; all those v-* attributes and custom components will be need to be migrated if you want to switch away from Vue. Comparatively, React is better in this regard because there are multiple implementations of React (preact, inferno, nerv). Also, JSX is technically optional, and it&#x27;s really easy to mix markdown, or other formats&#x2F;templating engines into a React app to handle the content-heavy bits.
评论 #17212763 未加载
wolfspideralmost 7 years ago
I think there is some confusion comparing jquery with frameworks in general heh- time for a history lesson! So back in the mid-aughts right before jquery there was prototype. I got hired into a job where I had to maintain sites written with both in the past and they were very similar to each other. Ajax was new and so was the class based handling of JS to make it more object oriented. It could be done but prototype made it convenient. It was possible to manipulate objects before applying them to the DOM however it was really verbose...academic I would call it. Then prototype’s cool younger brother arrives (jquery) and it became so easy to pull this stuff off it was like a giant party. Learn jquery? Your hired! Ahh the halcyon days ;) Anyhow- if you’ve lived through things like CGI and DHTML (and java servlets to a lesser extent) they were like the malaise era of web dev but jquery flipped the tables there has been NOTHING like it to date. We’ve gone back to academic with colorful packaging (I’m lookin at you angular!) and react coupled with redux just isn’t the same- it’s interesting but not a quick study. So..back then we could pick up a program in 24 hrs book and land a job. Today we can read 24 books and scratch the surface. Jquery was a movement not a framework and the statement being made was life is too short to NOT be incredible, we can all be incredible with jquery so why not? More comparable to the Misfits showing up to a Johnny Cash show than just another framework...just my two cents.
评论 #17212698 未加载
评论 #17213520 未加载
stevebmarkalmost 7 years ago
A common flaw in software engineers is writing thinkpieces about technology they don&#x27;t fully understand yet. Giving it a clickbait, not fully baked title is a bonus.<p>Move along. Engineers will continue to use good technology they understand (like React) while newcomers will continue to try to emotionally justify technologies they don&#x27;t want to learn and use.
danShumwayalmost 7 years ago
I agree with the spirit of what he&#x27;s saying, although I don&#x27;t think jQuery is a very good comparison to use.<p>React is a decision. I&#x27;m speaking in broad generalizations because I don&#x27;t know how to put this principle into more specific terms, but good programmers should avoid making decisions for as long as possible. This is the same reason why I caution people against using test frameworks. Most of the time when you start coding an application you won&#x27;t have enough information to make any educated decisions about it.<p>This is a huge advantage that Vue has over React. You can use Vue for just one component out of your entire app and it&#x27;s fine. It is fairly easy to separate it from all of the rest of your application logic and that means by extension it&#x27;s fairly easy to rip it out later. Or at least... easy enough.<p>It&#x27;s still not perfect. I dislike how hard it is to make its templates fail gracefully when Javascript is disabled. I dislike that it uses setters in its data model, which discourages immutable programming. I dislike a few other things as well.<p>At some point, someone will make a better framework than Vue, probably by building something even smaller and even more focused than Vue already is. But in the meantime, if you are going to use a framework for two-way data bindings, you should probably be using Vue instead of React. Opinion me, of course.
parvenu74almost 7 years ago
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.
评论 #17212163 未加载
statictypealmost 7 years ago
<i>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.</i><p>This is probably the only real concern I see.<p>jQuery is a library for DOM manipulation. It can co-exist with many other libraries.<p>React is an entire framework.<p>These days you need jquery less because browsers are more standards compliant and css animations basically work.<p>The trick is about using the right tool for the right job.<p>We have several large react applications - these are user-interaction heavy rich single page apps.<p>But we also use vanilla html and jquery dom manipulations in many other places.
评论 #17212446 未加载
评论 #17212311 未加载
评论 #17213130 未加载
danielrhodesalmost 7 years ago
Moved from Vue to React. A couple things drove this: Typescript support for Vue was kind of weak, and the interception of events and reactive elements ended up creating more bugs. I do love how Vue is easy to get up and going fast, but React seems more compatible with a growing team where you want stronger guarantees.
评论 #17213288 未加载
评论 #17212374 未加载
huy-nguyenalmost 7 years ago
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 using React and I remember Backbone was such a chore to manage in a large application. We switched to React and never looked back.
评论 #17212779 未加载
评论 #17212929 未加载
nobleachalmost 7 years ago
The problem was never jQuery. jQuery performed a very necessary function when it was created. It was always the intention of the lib to cease to be needed over time. The problem was&#x2F;is the ecosystem created around jQuery. Want to do a thing? Do it with jQuery. Want to read a cookie? Use jQuery. Want an image carousel? Build it with jQuery. Want to do anything at all? jQuery.<p>I do see something similar happening with our more junior devs. Their Google searches have now turned to &quot;how do I read a cookie with React?&quot;... and sure enough, there is a react-cookie lib - which may or may not be useful for their task... but since it says &quot;react&quot;, it&#x27;ll probably show up in a pull request. React can&#x27;t be blamed for this though. All the ecosystem being built with the expectation of &quot;well everyone&#x27;s using React&quot;, _is_ a problem.<p>Education about separation of concerns is the only solution I can see.
phraggalmost 7 years ago
Brad Frost makes most of his money telling people what they should do instead of actually _doing_ himself.<p>He&#x27;s given hundreds of talks all over the world about a component-based approach to style guides in web, but yet cannot fathom the need for React.
Achsharalmost 7 years ago
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&#x27;m crazy. But in the same breadth say the site feels so smooth and responsive. No shit.<p>Catch being you he to learn how to write js but that&#x27;s true for any framework as well. And frameworks have smaller shelf life anyways.
评论 #17213064 未加载
评论 #17212966 未加载
评论 #17213386 未加载
评论 #17212998 未加载
评论 #17213470 未加载
sheeshkebabalmost 7 years ago
React has a lot of inertia behind it, although it doesn’t really make things easier.<p>The amount of js code to make even basic things work is high, and with so many different styles of writing react&#x2F;js code, large codebases require significant effort to keep maintainable.<p>Which is to say, with this much effort put into structuring maintainable react js code, one could pretty much develop in any js ui framework (including jquery, backbone or none whatsoever) - since little of this effort is dependent on react, or made easier by it.
评论 #17212470 未加载
评论 #17212538 未加载
评论 #17212348 未加载
djsumdogalmost 7 years ago
I really like the linked Vue&#x2F;Jquery article in the story as well. I&#x27;ve built some stuff in Vue and I really like it. It can be incredibly simple.<p>I&#x27;m not a huge fan of React. I&#x27;m really not a fan of any site that requires Javascript to view. If it&#x27;s a new article and I get a blank page, I immediately stick it in archive.is. I&#x27;m not turning on Javascript for your site just to view content. Fuck that. Fix your site to not suck shit.<p>I realize you can easily get into the same thing with Vue .. and I think Vue, React and others, makes sense if you&#x27;re actually running a web application. Your main page, login page and other content pages should be static, no Javascript required. If you have a new site or a blog or graphics, why the hell are you requiring React&#x2F;Vue&#x2F;Angular or some other framework? Just display the content.<p>I haven&#x27;t really looked into server-side rendering, but I suspect that still requires Javascript to be enabled on the client? Are there any newer Vue&#x2F;React style front-end frameworks that are designed to still degrade gracefully without Javascript? (I suppose you can&#x27;t really do this without pairing it with the backend language on the server).<p>I really like how Hackernews still supports a Javascript-less system, even for things like up&#x2F;down votes (although I still turn JS on for HN to avoid page refreshes).
评论 #17214274 未加载
评论 #17213226 未加载
TekMolalmost 7 years ago
When I see this:<p><pre><code> var formname = $(this).find(&#x27;.formname&#x27;); formname.empty(); formname.append(n_input); </code></pre> I think why not just use plain Javascript and do this:<p><pre><code> document.querySelector(&#x27;.formname&#x27;).innerHTML=n_input; </code></pre> Coders that are attached to libraries and frameworks always seem so afraid to use the tech already available. That they don&#x27;t even look at how the basic solution would look like.
评论 #17214236 未加载
评论 #17213454 未加载
评论 #17213116 未加载
评论 #17213437 未加载
评论 #17214058 未加载
评论 #17213135 未加载
twfarlandalmost 7 years ago
This is from the guy who posted recently about struggling to learn React.
andrewstuartalmost 7 years ago
I don&#x27;t buy it.<p>ReactJS is a power tool and it takes some learning.<p>If your primary concern is about your initial learning curve then you should look elsewhere such as VueJS but I&#x27;m glad of the power of ReactJS.<p>Changing class to className is not a big deal, nor are the minor other bits and pieces mentioned in the post.
mpcalmost 7 years ago
We&#x27;re talking about two totally different programming paradigms here. The end product might be the same but it&#x27;s more of a question about how you arrive there.<p>With JQuery you&#x27;re signing up for manual DOM manipulation. It&#x27;s a challenge to scale that for what&#x27;s now considered table-stakes for web apps.
swyxalmost 7 years ago
i just find it amusing that everyone gets up in arms what Brad Frost struggles with in React because he&#x27;s famous. news flash: hundreds of devs face these issues every day and figure it out. Brad is famous and has problems with React; that&#x27;s fine. He&#x27;ll figure out a way that works for him. Doesn&#x27;t mean his opinion at all reflects the experience of the thousands of devs who are happy with React. Let&#x27;s move on and talk about more interesting things.
tracker1almost 7 years ago
Vue is for enhancing web pages.. you <i>can</i> do applications, but they get very complex beyond small-mid sized apps.<p>React is made for building web-based applications. You <i>can</i> do small stuff with it, but it&#x27;s often overkill.<p>Just because you can use a butter knife to turn a flathead screw, doesn&#x27;t mean it&#x27;s the right tool for the job. These days I might reach for Vue as a jQuery stand-in, but more likely, I&#x27;d use a smaller jQuery-like library, or just use straight vanilla JS, or other micro libraries. For anything big enough to deserve a build process React is absolutely my first choice.
评论 #17214434 未加载
nol13almost 7 years ago
&lt;3 jQuery, maybe nostalgia talking but still one of my favorite pieces of software ever. Made DOM manipulation fun.
评论 #17212383 未加载
pankajdohareyalmost 7 years ago
The JS world is so much more hype driven than say ruby, every few months they will have a new framework that promises to solve all the problems in ui land or the backend. They write songs in its praise everyone worships it like this is the one true framework a panacea for all evils. And then when the hype cycle winds down a new framework emerges. I am totally bored of looking at this cycle for the past few yrs. This just leaves a ton of unmaintainable projects in its tracks because the devs have found a new toy to play with. I have seen clients struggle to find backbone devs because no body in interested in Backbone this is a repeated pattern among JS Devs.<p>JQuery -&gt; Backbone -&gt; [Tons of Backbone wannabe&#x27;s written in Coffeescript Batmanjs&#x2F;Bananajs&#x2F;what not..] -&gt; Angular -&gt; [Angular lookalikes with tons of magic] -&gt; Ember -&gt; Meteor -&gt; React -&gt; Vue -&gt; [Wait a few months new framework in the Pipeline].<p>Unfortunately very few want to agree to the truth.
评论 #17212711 未加载
yakshaving_jgtalmost 7 years ago
Brad Frost has significant social capital and influence. That&#x27;s the only reason this charlatanry is given the time of day.
nielsbotalmost 7 years ago
Sort of tangential, but React is way less painful with TypeScript&#x2F;tsx. I combine that with an IntelliJ IDE (RubyMine specifically) and honestly, it&#x27;s a lot of fun to write web apps this way. (Maybe that&#x27;s because I come from an iOS background?)<p>Anyway, I recommend giving this setup a go.
评论 #17212805 未加载
joe_mommaalmost 7 years ago
Just skip React and Vue and go straight to ReasonML&#x2F;React, you will end up there in 3 years anyway
评论 #17214948 未加载
rbosingeralmost 7 years ago
As a member of a busy, small team with a Rails app and a jQuery heavy front-end... I agree. We use React in a few places and wanted to simply introduce it slowly and &quot;convert to React where we could&quot;. It simply has not worked out for us. We have typical server side rendered HTML that has been progressively enhanced with sprinkles of JS (jQuery + various plugins). We do not and cannot book much developer time for refactoring and can only really improve the code itself in bits using the &quot;boy scout rule&quot; (leave the area you&#x27;re working on better than you found it). For us, it turns out that yanking out chunks of jQuery and replacing them with React did not work out very well.
评论 #17213273 未加载
benatkinalmost 7 years ago
This comes from a well-known and respected thought leader. There are different types of thoughts, though. This is simply an observation:<p>&gt; Don’t @ me I’m not trying to start a controversy. I’m only stating an observation.<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;SaraSoueidan&#x2F;status&#x2F;1001189524477743105" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;SaraSoueidan&#x2F;status&#x2F;1001189524477743105</a><p>React, like jQuery, could have done more to keep people from writing bad code. With React, they made the same mistake that Angular did, which was to impose strict rules on all developers. Vue, to its credit, doesn&#x27;t make this mistake. It&#x27;s much less opinionated about state management.
评论 #17212790 未加载
评论 #17212476 未加载
Cub3almost 7 years ago
Since early in my career when hiring I&#x27;ve found developers who only know &#x27;jQuery &#x2F; Angular &#x2F; Vue &#x2F; React&#x27; but not the underlying Javascript, I swear &quot;x is the new y&quot; is said every time a new framework gets 6 months into vogue.
评论 #17214327 未加载
miklalmost 7 years ago
&gt; React is a big commitment. I guess that’s why I’m still struggling to comprehend why so many organizations are so eager to take the sturdy, foundational layer of the frontend stack and rewrite it all in a proprietary format.<p>There’s nothing proprietary about React. It’s all open source. MIT licensed. If you don’t like Facebook’s implementation, there’s like a dozen re-implementations. Hell, a modestly competent software developer could write his own implementation of React in a few days of work.<p>All else being equal, I’d say a React code base will be less of a maintenance hassle in the future, than the spaghetti mess you usually get when trying to write complex applications with jQuery (been there, done that).
fapjacksalmost 7 years ago
I like to shit on jQuery like anybody else, but it <i>did</i> have its place in the world. It was totally abused by people, but that doesn&#x27;t make jQuery <i>bad</i> 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 &quot;engineer&quot; who decided to write their weekend side project in Golang? It&#x27;s as much a fucking disaster as any of the bad PHP or jQuery stuff out there.
invaliduseralmost 7 years ago
JQuery is a great tool, it got a lot of buzz and people started to abusively use it out of its nominal scope. This does not say anything about jquery, only about people. React is having a lot of buzz, and the same abuses happen in places where it is nowhere needed. Same cause, same symptoms.<p>You can replace jquery&#x2F;react with any technology or concept, OO programming, functional programming, MVC, blockchain, machine learning, and every technology or concept having its momentum is or will be misused in some way at some point.<p>This happened, is happening, and will always happen.
i_am_stupidalmost 7 years ago
I am learning to code and a newbe.<p>I think jQuery != react.<p>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.<p>React can be used with jQuery for DOM manipulation. Described in react doc (<a href="https:&#x2F;&#x2F;reactjs.org&#x2F;docs&#x2F;integrating-with-other-libraries.html#integrating-with-jquery-chosen-plugin" rel="nofollow">https:&#x2F;&#x2F;reactjs.org&#x2F;docs&#x2F;integrating-with-other-libraries.ht...</a>).<p>Shall I learn jQuery at all ? Please, guide me.
评论 #17213883 未加载
dmitri1981almost 7 years ago
I wanted to try and address the points Brad makes and as well as clear up some of the misunderstandings in his post. Take a look <a href="https:&#x2F;&#x2F;medium.com&#x2F;@dmitrigrabov&#x2F;react-is-not-the-new-jquery-e42a19f165f4" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@dmitrigrabov&#x2F;react-is-not-the-new-jquery...</a>
jaequeryalmost 7 years ago
vue seem to be an evolution of react and angular.<p>it is as if some react developer sat down and said, “how can we make this even simpler so that even my grandson can do it.”<p>i appreciate when we have guys like the authors of Vue come forward driving the community and taking web development to the next level giving us a more elegant solution.
评论 #17214318 未加载
nreecealmost 7 years ago
Nitpicks aside, it seems to me that React&#x2F;Vue are only&#x2F;mainly useful for two-way data binding. If it&#x27;s just one-way binding (i.e. JSON to template), then jQuery with something like Handlebars will be just fine. Correct me if I&#x27;ve misunderstood.
评论 #17213887 未加载
sireatalmost 7 years ago
Coming from a background of doing embedded Javascript work(not web) I found React surprisingly easy to work with and joy to write code in.<p>React feels like writing normal Javascript.<p>Vue is very easy to embed into existing web page but feels like learning a new DSL instead of regular Javascript.
bigbadgoosealmost 7 years ago
&gt; I’m still struggling to comprehend why so many organizations are so eager to take the sturdy, foundational layer of the frontend stack and rewrite it all in a proprietary format.<p>it&#x27;s about workforce and durability of the platform
faitswulffalmost 7 years ago
Mods, can we change the title? The current title was clearly chosen to be inflammatory. Meanwhile, the original title only mentions VueJS, not React: &quot;Replacing jQuery With Vue.js: No Build Step Necessary&quot;
handbananaalmost 7 years ago
I don’t really agree for various reasons. That said, I’m not a huge fan of react, but am stuck working with a few code bases that use it.<p>I prefer vue, but I dislike that it’s essentially a one man show.
评论 #17212443 未加载
simion314almost 7 years ago
Does React or other cool frameworks have alternatives to jQuery UI components or you need to build your own calendars,dropdowns, accordions.
评论 #17213283 未加载
kaixialmost 7 years ago
That&#x27;s an incredible compliment.
oh-kumudoalmost 7 years ago
jQuery in terms of popularity? I&#x27;d take it as a compliment.
basejumpingalmost 7 years ago
This guy is such a phony.
xab9almost 7 years ago
The microwave oven is the new swiss army knife.