The Brutal Lifecycle of JavaScript Frameworks
stackoverflow.blog
stackoverflow.blog
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.
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!
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.
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.
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...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...
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.
Everyone loves a good rant about how fast the JS frameworks burn out, but it is not frameworks that burn out, but rather:
In the 8+ years since Iphone/Android duo made a HUGE change in how we consume web content, we went from:
- Having static resolution for websites to dynamically changing site resolutions - Having static HTML renders with some dynamic bits sprinkled over to full-blown SPA-s because of a variety of reasons* - Having major new JavaScript versions and INSANE amounts of Javascript engine speedups that allow things that were unimaginable 8+ years ago - Having gone from "nothing" to a CPU-based <canvas> to a full OpenGL ES-implementation, full GPU-based (<webGL>), - Had went from procedural code to semi-class based systems towards functional towards functional reactive programming systems
And I could go on and on and on and on.
The DOM api matured during these years. The renderers got replaced. Their performance altered dramatically. Layouts went from "JUST USE TABLES" towards CSS, then towards Compile-to-css alternatives, etc. Single-core event systems got SharedArrayBuffers, webWorkers, we got from callbacks to promises, towards async/await. And do not get me started on almost getting observables properly.
The web has seen more transformations in terms of what is an "app" or a "website" in 8-10 years than ANY OTHER area in programming. It is only natural that widely different tasks need widely different tools to work with.
I completely agree. Many people claim the web is overly complex, but then go back into the C++ world where you need a build tool to build your makefile which builds your project using cross compilation on a handful of platforms.
I like to remind people that 10 years ago Android didn't exist, streaming video was still only just becoming a thing, and the iPhone had just been released and wouldn't have an "app store" for another 6 months.
There have been several massive changes to the web and to computers and how we use them in that time. It only makes sense that we will use different frameworks and paradigms to create applications.
These frameworks are not as different, though, so I don't that's the driving force.
I think that the implicit argument of the article is that although new frameworks emerge, almost none of them get a large enough ecosystem or amount of adoption to become entrenched.
The other thing that the author hints at is that there is a relationship between server-side platforms and choice of JS framework. Ember got a small lift because it was co-designed by one of the best and most well-known Rails developers, but Rails people seem to have gone to React, and Angular seems to have been adopted by the C# community to the point that Microsoft and Google run joint events. Thus newcomer JS frameworks are less likely to get enough adoption to stick around, because server-side frameworks now have implicit default JS frameworks.
The Ember community made a proactive decision to abandon StackOverflow around the 2.0 release (about 2.5 years ago). StackOverflow simply does not provide the tools we needed. For example when you answer a question: Are you answering for version 1.0 of a library? 2.0? Perhaps the "correct" answer for each is different. Perhaps, over time, an answer that once was correct is now suggesting something deprecated or not in line with best practices.
StackOverflow doesn't provide any features for dealing with versioning and changes in what is correct over time.
If your community has a StackOverflow moderator, perhaps you can update all the answers you want on a regular basis. I don't know, because our community had no such person, and the StackOverflow team was disinterested in helping us come up with a solution (the Ember project reached out).
Additionally as a tool matures (Ember is over 5 years old) you take more of this stuff under your own wing. Ember has a robust set of companies offering video training, in person training, and books. We have a community chat, a forum, and very active meetups. All of these things are controlled by members of our community, meaning they can respond to changes more fluidly than StackOverflow (moderated by some people outside our community) ever could.
StackOverflow just is not designed for long-lived multi-versioned software. So guess what happens? Users of that software don't stick around on StackOverflow. For living projects the short-term trend will almost always look better than long-term trends.
Ember's story here is not universal. I'm glad there are developers finding StackOverflow useful for other libraries. I think the story StackOverflow should tell is one that focuses on what they do well. But to draw a meaningful lesson about the JS community as a whole from such a idiosyncratic data source is a fools errand.
For a hard numbers example of "trends" being poor, I develop a JavaScript diagramming library, GoJS: https://gojs.net
It has competition, such as JointJS, jsPlumb, etc. If I look at StackOverflow tags, I would think we're in big trouble:
* 180 questions tagged gojs
* 449 questions tagged jointjs
* 518 questions tagged jsplumb
These aren't even enough to show up on StackOverflow's trend tool, and they make the case look pretty dire for GoJS!
But behold, Google trends: https://trends.google.com/trends/explore?date=all&q=gojs,joi... (ignore the last, partial-data month)
In search interest GoJS is clearly ahead of these other two libraries. What's more, if you compare the forums for each product, you'd see that GoJS gets 10x-100x the traffic of the others.
StackOverflow is simply not the a good place to gauge library interest and activity over the long term, and its not a good place as you say to ask or find answers to questions for products that have ecosystems which continuously improve their APIs and evolve.
Here's Evan You (creator of Vue) https://youtu.be/D_z-RAweP1k?t=3m9s talking about the tweet.
It seems like a massive invasion of privacy (which I guess lots of websites are doing).
But to me that SO can so casually mention the mass surveillance and privacy invasion they're doing without thinking that there's anything wrong with it is the worst part of it.
I certainly never knowingly agreed that they could check my IP address and then try and figure out what company I work at from it.
EDIT: Once GDPR is live in the EU, I think it might be interesting to see if I can challenge this privacy invasion and inappropriate use of personally identifying data. I guess we'll see if GDPR has any actual teeth in this instance.
As it offers goods and services to EU citizens, it has to operate according to GDPR as far as I understand it.
And it does do sales in the EU, there are plenty of SO jobs being advertized (and paid for) in the EU.
Even if they aren't, I still wonder that if they're checking everyones IP addresses against that database, essentially sharing our access of SO with a third-party, would it still be an inappropriate use of personally identifiable information?
Quoting their website, "The organization name is available for about 40% of corporate, government, and educational networks."
IP data retention, on the other hand, will be interesting. On the one hand, law enforcement wants to have ISPs and companies to track and remember those, for future investigations. But on the other hand, privacy advocates want that kind of data to not be stored at all.
Here's the UK's ICO guidance for what you can process, as far as I can tell they've got no lawful basis for trying to match a user's IP address to a company without the user asking them to.
https://ico.org.uk/for-organisations/guide-to-the-general-da...
It seems like you're saying that analyzing IP addresses a user connected from in order to determine their likely employer is against the UK's GDPR guidance, even if the data is released only in aggregate (but that it might be fine to keep that IP data since perhaps there are other uses for it which would be legitimate). Is that your understanding?
> (b) 'processing of personal data' ('processing') shall mean any operation or set of operations which is performed upon personal data, whether or not by automatic means, such as collection, recording, organization, storage, adaptation or alteration, retrieval, consultation, use, disclosure by transmission, dissemination or otherwise making available, alignment or combination, blocking, erasure or destruction;
(Directive 95/46/EC)
All IPs are personal data (even if they are dynamicly assigned) if I read [1] correctly (Not a lawyer and there is most likely something I miss).
[1] http://curia.europa.eu/juris/celex.jsf?celex=62014CJ0582&lan...
This page gives it some context:
https://ico.org.uk/for-organisations/guide-to-the-general-da...
Further down are the 6 reasons for processing.
We know the first 5 don't apply:
consent - there's no consent
contract - it's not necessary to provide the Q&A answer site
Legal obligation - there's no legal obligation
Vital interests - nope
Public task - nope
So what it falls under is "Legitimate interests", SO want to use a user's IP address, process it to add company name, store that and then use that data for profiling their customers to serve them ads.One of the problems for SO is that further down they go into this a bit more and there's a few key questions:
Would individuals expect this processing to take place?
Are some of the individuals concerned likely to object?
Are you able to stop the processing at any time on request?
Which I would think would be answer No, Yes, No. Which seems to indicate that there's some problems with SO's approach.So what are we measuring here? It seems obvious that more popular frameworks would generate more questions, but so would:
- Newer ones which not as many people are familiar with.
- Poorly-designed ones which lots of people nevertheless use.
- Ones which disproportionately attract inexperienced devs.
It does seem like there are more of them and they rise and fall faster in the Javascript world, but this is probably better explained by the sheer number of Javascript programmers than anything else. The labor statistics I can find peg the number of US software developers in 2002 at around 612,000 and around 3.87 million in 2016 - and most of the new ones focus on web development. There are way more web programmers out there than there have really ever been, so it makes sense that the rate of frameworks appearing (and to a degree, the overall lifecycle churn) would be accelerated.
While true, none of them have changed so quickly as JavaScript ones, which seem driven by devs eager to create portfolios on Github.
Is this supported by any facts? It seems like a hand-wavey hasty generalization.
You just need to search on job boards.
The later graphs use data that's already not public (what tags users visit together, and what countries tags are visited from), so there's no reason not to use visits instead.
The graphs for visits over time do look very similar (in general question traffic by tag roughly matches questions asked, but as a slightly lagging indicator)
I would guess this is because the installer for Laravel (one of the most popular PHP frameworks) defaults to scaffolding a Vue.js app for your frontend.
In the JS world: not so much. But that prolly has many reasons. I can think of: the language changing rapidly, the community not very "close", people coming to JS from widely different places, and the fact that a JS framework can span either the FE or the BE or both!
Today it looks surreal that a mere portfolio of mind boggling animation effects would be enough to get a 21 year old an $84k job, but back in the time of peak web 2.0 craze, just having words jquery and 3 years experience on your resume was just enough to get 3 to 4 calls with ready offers every month.
You shouldn't base your usage assumptions on the amount of questions asked; Vue just doesn't require so many questions...
Some good ones: "thinking in React", "lifting state up", "controlled components", and similar docs in redux: "you might not need redux"
And from that perspective, will we see in the future off-the-shelf HTML components (based on React or Web Components) just like we can use custom Swing components ?
https://summit.polymer-project.org/
https://developer.chrome.com/devsummit/
You can some components here, as well as, the current state of browser support.
https://www.webcomponents.org/
Currently only HTML Imports seem to be a point of disagreement.
I am looking forward to them, as they can be the way for more sanity on Web development.
Up until this point, I usually would make most things from scratch and pull in libraries sparce. No big deal because my previous programs didnt need to. (Self taught programmer for 11 years.)
For the next 3 months, I'll be working on this almost alone. Is it worth using some of my resources to hire a React developer?
Also, this topic implies React will be gone in about ~5 years? That sounds good for me.
You can easily get by with someone that has years of Javascript experience instead, preferably a developer who's familiar with Functional-style JS.
I got my android app running which was easy after all the installs and updates.
Now I'm doing some weird command line stuff to try to get my Javascript server to wake up. Changing ports, more SDK updates, etc... Changing my App.js doesnt update, except if I turn everything off and back on again.
You can still do this with React. Some of the most-common general-purpose libraries for working with React aren't that big and could be written from scratch pretty easily. If you recognize when something's entire purpose is apparently to replicate OO features while staying "purely" functional by jumping through a series of awkward hoops, you can recall that the language you're writing in does, in fact, support OOP, and avoid the library altogether by using built-in language features (I keep seeing this in the React ecosystem and it drives me nuts).
Probably use Redux because everyone and everything expects that you are. It's easy to understand if you ignore their bad terminology and go in knowing it's just an event/messaging system, more or less. Action = event. "Action creator" = anything that dispatches an event. Reducer = your event handlers. Exactly what you'd expect from an event system with centralized event handling. Utterly mundane and non-magical. Figure out how to leverage "combineReducers" to keep your file structure sane and just go. The closest thing it has to magic going on is that when an event comes through it checks to see whether any of the refs in your "state tree" changed as a result of that event, and triggers re-renders on relevant connected view(s) (React views, in your case). That's it. Note that with a very little creativity one can decouple one's Redux code and most/all of one's business logic into its own library to share it between React and React Native.
If you use React Native, you're in for a treat if you're used to fully native cross-platform dev. It really does a great job of rounding off the many, many rough corners on Android that make it such a pain-in-the-ass to work with. Warning: the ecosystem's kinda nutty and does a bad job of keeping in sync, so avoid dependencies that directly target React Native as much as possible if you want to ever be able to, say, upgrade your React Native version without breaking everything. Pure JS libs that have no truck with React Native, good. Libs that add narrowly-scoped extra native integration for RN, usually good. Mostly JS libs that add on to React Native itself, typically just a disaster waiting to happen, no matter how nice they seem at first.
Oh, and use Typescript. For the love of god use Typescript. Just start the project with it, and never look back.
Brand new frameworks have zero docs and zero questions in Stack Overflow. Older frameworks have (hopefully) complete docs and a library of SO questions. In between you get a gradient.
I'm just not convinced that the data they're looking at means what they think it means.
Was honestly surprised to see Vue.js was so tiny in comparison to Ang and React regarding "% of Stack Overflow questions that month".
I thought it was much bigger
also keep in mind that Angular is complex enough to warrant 10x more questions. and React community, has done a lot of RnD in areas like flux, graphql, cssInJs etc. hence they too would have more questions.
I wonder what effect this has on usage. How likely are new developers to use it if virtually every question they have is answered by this (no matter how irrelevant the answer should be today).
Including jQuery for one small task would be stupid.
Including jQuery in a non-web project would be weird.
Including jQuery in some es variants would be impossible.
And while I agree with the second, I'm talking about general language questions not related to web in any way (no DOM manipulation, no http requests, etc..).