3 ms·
You're not wrong in hating React, but it is a fad as much as no one wants to believe it. The reason I believe is because no matter how strong the framework, eve
by acconrad 10y ago
You're not wrong in hating React, but it is a fad as much as no one wants to believe it. The reason I believe is because no matter how strong the framework, eventually it will be adopted (to some extent) into the native language (which is a good thing). Think about these frameworks:
- jQuery
- Coffeescript
- Backbone
at the time, if I had asked you if those were a fad, you'd think I was crazy. And yet, because of native language enhancements, none of those frameworks are really needed anymore. And I'm sure in 5 years React, Angular, Vue, Ember...you name it, will also likely be a thing of the past.
The important thing that I've learned in my (so far very short) career is that it's always best to know the language first, and the framework second. Frameworks come and go, but the language is permanent. By knowing the language really well, it's strengths and weaknesses, it enables you to determine when a framework is helpful...and more importantly, when a framework is a hindrance.
As an anecdotal example, I had a client that was using a React boilerplate on NPM to do a Foursquare API request. React is like, 50k lines uncompressed? To do that? I was able to replace it with 22 lines of vanilla JS. If you don't know the base language, it's often easier to simply think in the framework and create a bloated environment for very basic things rather than just use what the language gives you. It's faster, it's cleaner, it's more widely supported in browsers, has a larger community, and is more defensible to use the base language than a framework, until the framework does more work to help you than harm you.
So my advice would be, if you're thinking about using React or Angular, think about why you need it. Are you doing heavy lifting on the front-end, like interactive graphics or a dashboard? Sure, those are probably pretty good choices. If not, and you're simply trying to make the front-end more RESTful, with some easier reasoning about your applications, you could probably get away with a lighter framework like Mithril, Elm, or another lightweight framework.
- RubyPinch 10y ago> at the time, if I had asked you if those were a fad I still wouldn't call jquery a fad, just obsolete
- nmgsd 10y agoAre you perhaps thinking of JQuery UI? The core JQuery lib is still used. And for basic front end dev it really does offer most of the utility you'll look for in other libs. 1. Get and manipulate dom elements. 2. Register simple event handlers 3. Ajax calls that are simple (frankly all other ajax-ish APIs I've ever seen pretty much copy the design and approach of the JQuery one). Also a pretty big ecosystem of simple highly focused add-ons. You (still) can get a long way with just JQuery
- nevon 10y agoYou can, but it pretty much is obsolete at this point. 1. `document.querySelector()` and then just modify the DOM however you want. 2. `node.addEventListener()` 3. `fetch()` There are still things that jQuery provides that aren't as simple to do with the built in functionality, but in most cases, you can get by just fine without pulling in all of jQuery. And in those cases where you can't, there are more focused libraries available for those specific use-cases.