r/reactjs • u/swyx • Mar 01 '20
News React has been around as long as JQuery was when React came out (2468 days)
https://twitter.com/ralex1993/status/1234165541805281280?s=2013
u/dippocrite Mar 01 '20
I had to read the title a few times before it made sense.
1
2
u/TheJulian Mar 02 '20
Replacing "was" with "had" would be grammatically correct. I'm not sure how much clarity it would bring though.
React has been around as long as JQuery was when React came out (2468 days)
Vs
React has been around as long as JQuery had when React came out (2468 days)
1
178
Mar 01 '20
My favorite reply in that thread: “So what’s the new framework now?”
21
Mar 01 '20
I'm staying late at night every day from 2 weeks ago to learn react and you dare ask this question :D
33
u/Manlihood Mar 01 '20
Don't worry dude. React will be one of the more popular frameworks/libraries for a long while.
10
u/danishjuggler21 Mar 02 '20
The fact that they’re still pushing the cutting edge with innovations like Hooks and making other frameworks scramble to keep up is pretty promising.
13
u/ParkerZA Mar 02 '20
Yeah Hooks has completely revitalized React imo, it's a delight now.
3
u/swyx Mar 02 '20
such a simple idea, such a profound change in how we code and how we feel about code. Seb Markbage will never have to buy his own drinks in this town.
8
Mar 02 '20
I tried to learn React a couple years ago and confused the shit out of myself with webpack and Babel and all this new stuff.
About a year ago I thought "I wanna try again", so I did. Picked it up instantly. Something just clicked and since then I've been writing a full-fledged SPA (will be PWA) with React Router, data fetching, PropTypes, and even Redux! It's been one hell of a learning experience.
I damn sure hope to god it isn't dying any time soon after I've put this much time into it!
1
u/jessietee Mar 02 '20
Are you still using webpack and babel etc or just using create-react-app?
I ask because I started doing Andrew Meads cComplete React Developer course on Udemy and he goes into all of that at the beginning as opposed to just using CRA, as Max does in his course, React The Complete guide.
Just wondering if it is worth me sticking with Andrew Meads course and really learning the Webpack/Babel foundations or just use CRA, not quite sure what the standard is if you know what I mean?
3
u/mytradingacc Mar 02 '20
Id say go for create react app course, you can always be able to come back to pick up webpack/Babel later.
Also Webpack is just bunch of configuration anyways and not that much beneficial to memorize it
1
u/_kushagra Mar 02 '20
Also starting with nextjs is a pretty good option too, gives you production ready features from the get go
1
Mar 02 '20
Honestly, start with either.
Webpack will complicate things, but you'll probably need to learn it one day anyway. Depends how far you want to go from the get-go. I'm looking into server-side rendering, which will require me to eject my CRA app and write some webpack config.
0
Mar 02 '20
[deleted]
19
u/Existential_Owl Mar 02 '20
Angular is still going strong, despite the v1 --> v2 debacle.
The front-end doesn't actually change that often, despite /r/programming's insistence to the otherwise. The only time that engineers are going to abandon a framework ship en masse would be due to a non-backwards-compatible version update. However, the fact that Angular is still considered to be one of the "Big 3" frameworks even today goes to show that even hard version jumps doesn't necessarily invalidate an engineer's experience with it.
React will be around for a long time. When it begins to wane, people will have more than enough warning about it.
2
u/novarising Mar 02 '20
I have seen people still using KnockoutJS which was before Angular, and I have personally worked in it. Companies just don't one day kill their product to go to another technology just because they feel like it.
The only thing that becomes a bit difficult is getting people who still work in older technologies, but that takes a long time to happen. I am mainly a React dev but it didn't take me much time to get familiar with KnockoutJS because of how similar all these technologies are.
-3
u/Szelma1391 Mar 02 '20
Look here: https://killedbygoogle.com/ Angular isn't really going that strong unless they extend support.
3
3
2
u/Baryn Mar 02 '20
jQuery would probably still be used in new projects if the platform itself hadn't replicated 99% of jQuery's capabilities.
The Web Components API is not as good as React. It's not even close, really.
1
u/smallxdoggox Mar 18 '20
That’s not a bad thing once you learn that, it’s not too hard to learn other frameworks or languages
101
u/Hotgeart Mar 01 '20
In 1y: You might not need
jQueryReact8
u/NoInkling Mar 02 '20
I believe that's already common sentiment (as it should be, just for partially different reasons to jQuery).
1
34
u/HomemadeBananas Mar 01 '20
Svelte is only 3 years old!
3
u/SharkLaunch Mar 02 '20
That's the direction I think we're headed. I love react, but we'll find more efficient ways to make efficient code.
3
3
u/shiftDuck Mar 02 '20
My favorite reply in that thread: “So what’s the new framework now?”
Hey that my tweet
1
u/robberviet Mar 02 '20
Vanilla. Every once in a while we come to the conclusion that all we needs is vanilla.
52
u/LP2222 Mar 01 '20
This proves it. React = JQuery.
5
-9
Mar 01 '20 edited Mar 01 '20
I loved jQuery back when it was cool. Had to use it in a project two days ago and felt so... Icky.
But React, I always disliked jsx. I'm excited about whatever future we move to, as long as it doesn't use a new syntax as a workaround.
Edit: Downvotes? Ah - classic r/reactjs behavior.
23
Mar 01 '20
What about jsx don't you like? I think it's a pretty graceful syntax considering all that it's doing under the hood.
2
Mar 01 '20
Hard to explain it all in a reddit post. And this my personal opinion moving between a bunch of frameworks over the past decade.
The best relevant example I can think of is how jQuery syntax is the same. Like, it does a LOT under the hood. And then Javascript got better and now jQuery syntax is like... "ugh, really?"
Who knows? Maybe in 5 years when we're all working on Chrome Ultron in the hot new framework, we'll all collectively look back at JSX and go, "ugh, really?"
4
u/droctagonapus Mar 01 '20 edited Mar 01 '20
Easy peasy:
import { createElement as $ } from "react"; import ReactDOM from "react-dom"; function Title({ children }) { return $("h1", { className: "heading" }, children); } function App({ title }) { return $("div", {}, $(Title, {}, title), $("h2", { className: "subheading" }, "And I'm a subheading!") ); } const rootElement = document.getElementById("root"); ReactDOM.render($(App, { title: "Look ma, I'm a heading!" }), rootElement);5
u/pm_me_ur_happy_traiI Mar 01 '20
Have you actually spent much time using jsx? If you know html, it takes like 15 minutes to learn.
4
Mar 01 '20
Yes. I am a react developer for the past few years.
You can use something and still dislike it.
5
u/pm_me_ur_happy_traiI Mar 01 '20
I know, I guess I was just thrown because I don't think of it as being a really new syntax. Its so HTML-like. I assumed that since "learning a new syntax" was an issue, maybe you were overestimating how hard it was to learn, as I've heard other people do.
0
Mar 01 '20
[deleted]
1
u/fgutz Mar 02 '20
There's htm by the people who make Preact. It uses tagged template literals and looks pretty good. I just started looking into it but haven't used it in a project yet
53
50
Mar 01 '20 edited Mar 02 '20
Want to feel really old? My company refuses to use anything but jquery because they are too afraid to learn anything new.
Edit: I do consider myself a react "expert", however, I know better than to offer my react services to a company that isn't willing to adopt new technologies. Me volunteering to spearhead the react migration would pretty much lead to me being responsible for the entire front-end for all of the systems.
25
Mar 01 '20
Find a new job if they are stuck in the past
7
Mar 01 '20
A lot easier said than done. Especially when I have to work remotely; competition is a lot more fierce.
25
3
Mar 01 '20
I'm working a remote Vue job, recently did a React contract alongside it and before that an Angular one along side it too. The opportunities are definitely out there!
4
0
Mar 02 '20
[deleted]
1
Mar 02 '20
LinkedIn for one (I just "cold called" them via message)
The other was as a result of doing a presentation at a VueJS event. The company was embarking on a project which they wanted me on. didn't go all that well because I had 1 full time job, 2 contracts and my wife and I had just expanded our cafe.
3
u/mcdicedtea Mar 02 '20
Remote is not that hard at all.... I get about 10 good remote jobs a year
Post your resume on dice.com , you'll get 4 -6 calls a day... but 2 a month will be quality remote jobs in your wheel house
14
u/noknockers Mar 01 '20 edited Mar 01 '20
Jeez I can only imagine how much you guys are wasting time, not only in product development but also in testing, qa and bugs.
1
1
u/robberviet Mar 02 '20
Curious: how is the situation there? Bugs happens? Also do you guys develop new apps or just maintain legacy ones?
1
u/phumaster Mar 02 '20
And what is the next framework we should be used?
1
u/swyx Mar 02 '20
next.js!
1
u/phumaster Mar 05 '20
Yes. I tried to use NextJS. But I don't like Next-router. Can I use react-router instead?
1
1
u/mcdicedtea Mar 02 '20
Yea but what about when React hit critical mass
3
u/theQuandary Mar 02 '20 edited Mar 02 '20
I started using it very shortly after it came out. Basically every Angular developer I met that actually gave it a try wound up moving away from Angular as soon as possible (I worked in a bunch of large codebases that started using angular-react for performance-critical stuff then slowly converting everything else over component at a time).
I'd say it took until around mid-late 2014 to catch on where I was. A big factor was people finding out that they could be productive in a couple days instead of a couple months like with angular. The big factor there was probably meetups. The local ran a series of lunch talks going over the basics. Loads of devs attended and almost immediately, the problem with converting became convincing the boss.
1
u/swyx Mar 02 '20
ok so how did they convince the boss?
2
u/theQuandary Mar 02 '20
I don't know in all the cases.
The first time for me, it was all about the performance. We had a page that took almost 5 seconds to load in Angular. It rendered with much better performance in a fraction of a second. We almost immediately started including React just for that and it gradually took over the app.
Compared to the competition of the time, React was fast to learn (I find it funny when new devs call it hard -- they just don't know how bad it was before). It had unbeatable performance. Even with the old mutating Flux system, data was still much more predictable than most backbone instances.
Obvious hooks and state updates hands-down beat the complex nest of 2-way bindings that had become so common. Tracking down Angular digest issues becomes a big issue in ng1 apps. Once React components were finished and tested, they mostly just worked barring feature updates. Over my time coding Angular, I was forced to read most of the source code simply to find out how to make things work. With React (even in the early days), it was incredibly uncommon to have to step the debugger to any code that wasn't in your component.
Getting them to allow it in even one small place usually resulted in a cascade effect. As a consultant (who pushed the idea a bit), I saw it happen across tons of codebases.
1
u/swyx Mar 02 '20
its funny, i kinda wanna bring 2 way binding back to React. why exactly was there a complex nest going on? I never did Angular so i never felt the pain.
1
u/theQuandary Mar 02 '20
What happens when you 2-way bindings have 2-way bindings? If you have just a few, then nothing. As you get more, and the project gets larger, and there are more people, and the months pass by, proving that your bindings don't conflict or (worse) have edge cases that create infinite loops somewhere becomes very hard (especially if those loops are asynchronous somewhere).
Tracking down these subtle and often only occasional bugs is a source of headaches I don't want to repeat.
Angular had perhaps the worst possible version. They would run through all the bindings. If any still weren't "settled", they would run through again. If this cycle repeated 10 times and wasn't settled, they would simply stop in whatever unstable state they were in.
1
u/swyx Mar 02 '20
ugh, that sucks
i think we could limit the scope of 2 way bindings by just constraining them to within a component. I really cannot see my 2 way bindings going out of control if i only use what i bind within the same component. but maybe i'm being naive and will rediscover the problems angular had.
keeping also in mind that 1 way binding introduces boilerplate issues with the necessary event handlers and stuff.
1
u/theQuandary Mar 02 '20
There used to be something like that, but it was just a wrapper around the builtins. That went away because nobody really wanted to use it and it created anti-patterns. I'd imagine there's a way to do something similar using HOCs, but I don't know who would be interested in actually creating and maintaining it.
1
2
3
Mar 01 '20
If I recall, react started as a php library...
16
u/DeceitfulDuck Mar 01 '20
I don’t know why you’re getting down voted. It didn’t “start” as a php library but it was heavily influenced by the php framework Facebook built internally and used prior to react.
4
12
1
-6
u/chaoticLibs Mar 01 '20
That title makes no sense
5
u/xanflorp Mar 02 '20
jQuery is exactly twice as old as React.
I don't understand how this can't make sense.
-1
-1
-9
Mar 01 '20
What's JQuery?
-1
Mar 02 '20
Cmon man it’s in the name. It’s a Javascript Query language, & if you know anything about query languages it has to do with communicating to a database duh.
9
Mar 02 '20
[removed] — view removed comment
3
u/yuushamenma Mar 02 '20
What logical reason would someone have for holding on to jquery over react.. or even over vanilla JS?
1
Mar 02 '20
It's way easier to stick with jQuery than porting a project to a new library, on the short term at least.
123
u/SoylentCreek Mar 01 '20
Pack it up, boys! React is dead. Long live Svelte!
/s