So of course there's going to be less questions asked about jQuery in 2017 versus 2009, because if I need to figure out how to select elements based on an attribute rather than a class or id, it's already there.
So of course there's going to be less questions asked about jQuery in 2017 versus 2009, because if I need to figure out how to select elements based on an attribute rather than a class or id, it's already there.
The same path is likely on all frameworks - they were designed to solve specific use cases, and as the entire industry matures, different solutions will embed themselves in the industry in different ways, reducing the raison d'etre for each framework, over time.
Actually many who did jQuery were proud of it.
Some of us made rock solid sites or improved exiting ones quite a bit using a technology known as progressive enhancement.
Let me tell you what is fragile: the cool things I make today that won't even try to work if I disable Javascript. :-)
Edit: and given what we have seen over the last few days now would be a good time to reconsider if every website really needs to be able to run Javascript.
It's going away because you basically have to write everything twice and it's hell to keep consistent.
Is it just me, or are many of the newer frameworks actually harder to use? I tried Angular 1 about 4 or 5 years ago and it seemed like a complete disaster. Recently, I've been working on Vue and this seems a bit better.
> Is it just me
Probably.
Once your SPA goes through an iteration or two with a few different programmers, you find your events have nasty ordering dependencies and your data becomes inconsistent all on its own. You have no idea why because you can't reproduce any of these issues on your own. You have to watch other people interact with your app just to reproduce bugs ("why the hell would you double click a link?") and git bisect becomes the most productive tool in your toolbox. Most project discussions end with a shrug. You yearn for the days when it was possible for a single human to ever understand the entire app, but that was six months ago and management steadfastly refuses to fund a rewrite. You look wildly around for any sign of hope...
As for Angular, agreed, but I'd rather work with it than a bunch of jQuery. React and Vue are quite pleasant.
Not at all. The issue with an application written in jQuery is a lack of sane state management. Forgetting to initialize (or re-initialize) values, not expecting things to be executed in a different order, and just poor organization in general led to mountains of runtime errors.
Nowadays we use Elm. The difference is night and day. I wrote a post on this topic a few months ago: https://charukiewi.cz/posts/elm/
Need to target IE 11 and FF ESR currently.
Another, bigger factor is that most modern frameworks use some form of templating and binding which means that you have less need to modify/interact with the DOM directly.
$('.my-component div').css({ background: 'yellow' })
vs. Array.from(document.querySelectorAll('.my-component div')).map(node => {
node.style.background = 'yellow';
})As for simple/readable it’s the same code but s/map/forEach.
forEach is much more indicative of what you're actually doing here, which is running through an iterable and mutating properties on each node.
Simple rule of thumb: if you're not using the results of `map`, you shouldn't be using it.
document.querySelectorAll('.my-component div').forEach(node => node.style.background = 'yellow');
https://developer.mozilla.org/en-US/docs/Web/API/NodeList/fo...From my perspective, it appears that React is still very much in ascendancy.
React-router, Redux, Webpack, Material UI, etc.
So even though the API itself small, there's still an endless number of questions out there for people to ask!
It just works, and takes up much less of my mindshare than trying to learn various frameworks every time I roll a new site (which incidentally is every 3 - 6 months). There is always more support for it (with all the questions being answered), and the API never changes. I actually develop faster, although typically I’m using web frameworks with templating backends - such as Rails (Ruby), Django (Python), Flask (Python), and Revel (Go)
On simpler projects, JQuery is more productive. But my main point is to program where it is comfortable and practical. The better academic choice is not necessarily the better choice. View your programming resources as people and make the pragmatic choice.
I don't use jQuery by itself these days, of course. I'm using it in combination with mithril.js (not as popular as React, but similar in concept) at the moment.
Speaking for myself, it was often easier to copy / paste SO answers (in jquery) than try and figure things out for myself. I can imagine a lot of beginning developer start with jQuery and go to advanced frameworks after that.
* most sites aren't SPAs, and progressive enhancement of a document with light interactivity via jQuery is a development model that's a good fit for those sites
* progressive enhancement of a document is an easier development model to move into from having started to author HTML & CSS than many of the SPA frameworks (note that this is also true of PHP), and many training materials that bring people into web authoring use js+jQuery as the next step
* many sites aren't rewriting their codebases particularly frequently, and anything used there remains relevant longer.
Yet there are counter examples that show that can't be the complete story: http://sotagtrends.com/?tags=[jquery,python]&relative=false
Once you know what $().append().on().trigger() does, there's not that much left to know about jQuery. And most everything can be understood from docs.
Python, however, is a continuously evolving language with an ever expanding number of libraries and areas of application.
1: http://sotagtrends.com/?tags=[jquery,angularjs,c,c%2B%2B,rub...