r/programming • u/peterxjang • Sep 20 '16
Why Vue (Not React) Is the New jQuery
http://anyonecanlearntocode.com/blog_posts/why-vue-not-react-is-the-new-jquery46
u/skizmo Sep 20 '16
jQuery is the new jQuery... it's also the old jQuery.
8
u/justanotherkenny Sep 20 '16
I can't agree more. Why does everybody hate on jQuery? I always hear arguments about how it ends up making your code too complex / unmaintainable, but that seems like rubbish to me.
Meanwhile, the proposed replacements (angular, ember, react) are literally rewriting their core code because either it got too complex / unmaintainable or some other major deal-breaking flaws ocurred.
new and shiny != dependable and battle-tested
10
Sep 20 '16
To me, comparing Angular or React to jQuery makes no sense whatsoever. Those frameworks work on wholy different level of abstraction than jQuery, which is much more low-leve. It's almost like comparing assembly to Python.
-2
u/justanotherkenny Sep 21 '16
If you think jQuery resembles assembly, you are definitely doing it wrong.
2
Sep 21 '16
I said no such thing.
0
u/justanotherkenny Sep 21 '16
I guess I just can't see how someone can think that jQuery is low-level.
1
Sep 21 '16
Well, those frameworks are meant for organizing and structuring whole applications (or at least the view part), they work with whole bundles of data (ie. of application state, etc.). AFAIK jQuery does none of that, it just lets you do stuff like DOM manipulation, AJAX, etc, basically, it rectifies browser API shortcommings, but that's it. I can easily imagine an application framework designed on top of jQuery, using its DOM manipulation abilities and such under the hood.
(btw for the record, I didn't downvote you.)
1
u/justanotherkenny Sep 21 '16
I mean, most of my js framework experience was in ember and it was super frustrating. The documentation was crap and it was very difficult to find help elsewhere. Not only that, but they would constantly deprecate parts of their api and rebuilt their rendering engine twice. It feels like building on quicksand while every new major problem you run into is new and unique to you. Nothing on SO.
Oh, but you can pay a consulting company that employs the core members $250 / hour base rate for training or help. :|
0
Sep 21 '16
[deleted]
1
u/justanotherkenny Sep 21 '16
jquery is on a lower abstraction level than the other technologies
If that was the case, I would see your point. I am of the opinion jQuery is the lowest barrier to entry for (web) app development. If you know html/css selectors well, you're well on your way to knowing jQuery. That's not the case with most of these emerging frameworks. Couple that with the fact that I can google any problem with jquery and have ten pages of other people who have solved my problem. Try googling common problems with a brand new framework.
0
Sep 21 '16
[deleted]
1
u/justanotherkenny Sep 21 '16
Can you give me a concrete example of what you're talking about? When building a web app front end you basically have to do two things minimum: make http requests and manipulate the dom. jQuery makes both of those things abundantly easy. Whichever shiny new unspecified framework you're saying makes life simpler will probably cause more pain than it claims to fix.
→ More replies (0)0
3
u/flying-sheep Sep 20 '16
You missed the main point of the article: code written with jQuery is hard to maintain. You're talking about jQuery itself, which obviously became more robust in the past decade.
4
u/VGPowerlord Sep 20 '16
It started becoming more robust once they started pulling out the compatibility stuff for older IE versions in jQuery 2.0.
Then again, it also became less useful when said support was pulled because modern browsers tend to do things in a more standards-compliant way and you no longer need all the compatibility hacks.
7
Sep 20 '16
code written with jQuery is hard to maintain.
I call bullshit on that one. jQuery's been around about a decade now and has lots of mature projects out in the wild. Come talk to me in another 5-7 years when everyone starts calling React hard to maintain. Hell, with Angular it took less than 3 years.
0
Sep 21 '16 edited Sep 21 '16
I call bullshit on that one. jQuery's been around about a decade now and has lots of mature projects out in the wild. Come talk to me in another 5-7 years when everyone starts calling React hard to maintain. Hell, with Angular it took less than 3 years.
React is fundamentally different in that it's a stateless functional one-way pipeline, which is inherently easier to manage, compared to APIs like jQuery and Vue are, which are used to drive spaghetti-prone state machines.
I'm not blaming jQuery or Vue for being stateful, but state always allows people to mess up, and then they blame their tools. React takes that opportunity away through its architecture.
Regarding Angular, I saw the criticism for Angular coming before it even existed. It was architecturally flawed from the very start, and I don't know why libraries keep trying to make two-way binding happen. It won't happen. Not in Angular, not in Vue. It'll always be fragile, limited and perform poorly.
React will never get that kind of infamy. It might be bashed for being limited maybe, or god knows what, but it's stateless and it's not two-way binding, so just this alone puts it in a better category.
2
Sep 21 '16
You missed the main point of the article: code written with jQuery is hard to maintain.
Poor craftsmen blame their tools.
2
u/flying-sheep Sep 21 '16
Obviously a good carpenter could build something relatively good with bad/unsuited tools.
But because he's a good carpenter, he'll decide to use better ones.
3
Sep 21 '16
jQuery is just a thin wrapper over browser APIs and some of their quirks. The only thing it does is allow you to express the same intent more compactly and with less edge cases.
To blame someone's code quality on the fact they used jQuery is non-sense, insofar jQuery doesn't prescribe a specific architecture for you, it simply improves access to browser APIs.
If someone can't code right unless their tools force them to, maybe they need something more elaborate, like a framework, to be their training wheels. But jQuery never set out to be a framework, so it makes no sense to blame it for not being a framework.
-1
u/flying-sheep Sep 21 '16
Its abstractions are in my experience well suited for one-shot DOM manipulations, but not for frameworky stuff.
Therefore you're right: it's a bad idea too use it for that. And since we were talking about bigger sites/applications, that means i was right too, and jQuery leads to unmaintainable code there.
3
Sep 21 '16
That's not what I said. I said it's a library without opinion that is as capable as the person using it. Its goal is to make DOM and AJAX more compact and predictable across browsers.
It can be used in apps ranging small to giant. It can be used ranging horribly to excellently. It's not a "bad idea" to use it for large apps. It's only a bad idea in the hands of someone who feels clueless about how to design their own app. And sure I've seen juniors mess horribly with jQuery. I've also seen them do better after some training. That's why experience matters in programming.
It's a sad state of affairs that we've become so dependent on someone else thinking for us, that we insist that every library under the sun should be a massive and rigid hand-holding framework.
Some of us can code, you know. We're fine with being allowed the liberty of architecting on our own.
0
u/flying-sheep Sep 21 '16
d3 is something with a selector and batch modifying API that lends itself to building bigger things IMHO.
Else I just tend to create my own data structures if I work low level
-2
u/markasoftware Sep 20 '16
I personally hate jQuery because it's completely obsolete. Anything you can do in jQuery can be done using HTML5 methods with a similar amount of code. Using
$as a cross-platform way to select with a CSS selector 5 years ago may have been amazing, but today you can implement that with justvar $ = document.querySelectororquerySelectorAll. The fetch API is going to be just as good as jQuery's ajax API. The DOM manipulation stuff has mostly been replaced by MVCs like Angular, React, Vue, Mithril, etc. All jQuery really does at this point is add a whole bunch of bloat.1
u/Fat_Dumb_Americans Sep 23 '16
(Best viewed in HTML5 supporting browsers)
It must be nice to be able to turn down lucrative legacy maintenance-code gigs.
1
u/markasoftware Sep 23 '16
most of the features I'm talking about have been supported for a while. Queryselector is since ie8.
1
u/Fat_Dumb_Americans Sep 23 '16
Falling back to ie8 is not the degree of legacy support that I'm referring to.
1
24
Sep 20 '16
I've recently started getting into the JS world because I hate having this huge knowledge gap, but I'm already sick of it :(
16
u/bluebaron Sep 20 '16
If you're just now making your foray into the JS ecosystem, I would really advocate focusing solely on learning the language itself and its quirks (preferably ES2015 and how its features can be achieved in ES5). These frameworks and their time in the limelight can't be relied upon, but having a good idea of what's going on underneath will be invaluable.
2
u/reddeth Sep 20 '16
Do you have a book, site, or resource that you feel gives a good overview on learning the language itself?
I'm a back end web developer, but I'd love to learn more about JS than I know now. Because right now it's basically... well it's jQuery, if I'm honest.
1
u/sanegulp Sep 20 '16
Nicholas Zakas' books are great and in depth overviews of Javascript language and how it works behind the scenes. Professional Javascript for Web Developers and Understanding Ecmascript 6 are pretty good imo.
1
u/reddeth Sep 20 '16
Awesome, thank you! I'll take a look at them!
1
u/sanegulp Sep 20 '16
Understanding Ecmascript is actually free to read online However, it is mostly about new stuff of ES6/ES2015 so it assumes some pre-existing knowledge of JS though imo not too much so you might want to pick the other books first.
0
Sep 20 '16
[deleted]
3
u/justanotherkenny Sep 20 '16
So what are you going to do when angular 1 gets deprecated?
0
Sep 20 '16
[deleted]
1
u/justanotherkenny Sep 21 '16
Right, but there will be a point at which google will stop maintaining angular 1. I don't see that happening with javascript or angular 2 until google decides to rewrite again.
41
15
Sep 20 '16
Vue provides an answer to the issue of JavaScript fatigue, and it is a worthy successor to the legacy of jQuery as the ideal entry point for beginners to the world of modern frontend development.
Provides an answer to, or is contributing to? Hint: it's the latter.
2
u/this-just_in Sep 20 '16
There are only a few genuinely common frameworks these days and many other attempts to refine them with vastly smaller communities. This is hardly a problem. The real irritants are the marketing/hype and the short-lived nature of them. The solution is simple: use one of the common frameworks. Ignore the rest of them unless you feel like seeing someone else's take.
1
1
u/xxxabc123 Sep 21 '16 edited Sep 21 '16
I get your point since it's another JS framework that adds to the list of annoyingly endless options in JS ecosystem.
However Vue in my opinion differentiates itself with a minimal API with an easy learning curve and requiring no magic build step and confusing you with server side rendering, pollyfills, transpilations etc. I used in a school project once and it just worked outside the box.
Consider Angular completely breaking its user space in v2, and having a daunting documentation including stuff like "transclusion" (as a non-native speaker, a few of these were enough to scold me off Angular); or React which expects you to learn JSX syntax and transpile your code and learn all its Flux / Redux / High order components. I'm a huge fan of React, but none of these issues happened to me with Vue so it definitely has a chance to decrease JavaScript fatigue if it follows in the current direction.
0
Sep 21 '16
I get your point since it's another JS framework that adds to the list of annoyingly endless options in JS ecosystem.
Right on.
However Vue in my opinion differentiates itself with a minimal API with an easy learning curve and requiring no magic build step and confusing you with server side rendering, pollyfills, transpilations etc. I used in a school project once and it just worked outside the box.
Nothing you listed is required for React development. You're totally free to include the JSX transpiler in your browser and not ever build it locally. You're also free to not use JSX at all (although that'd be silly). Server Side rendering is especially not required.
Consider Angular completely breaking its user space in v2, and having a daunting documentation including stuff like "transclusion" (as a non-native speaker, a few of these were enough to scold me off Angular);
Angular 1.0 is utter garbage. Nobody is arguing with that. It has inefficient rendering, the API is awful, the paradigms aren't good, etc. It's just a giant piece of technical debt.
or React which expects you to learn JSX syntax and transpile your code and learn all its Flux / Redux / High order components.
Again, React does not expect you to do any of that. You're totally free to build out your app however you want.
I'm a huge fan of React, but none of these issues happened to me with Vue so it definitely has a chance to decrease JavaScript fatigue if it follows in the current direction.
"I like it so it reduces JavaScript fatigue." This is not what JS Fatigue means. You've chosen a thing and stuck with it, regardless of hype. That's the absolutely correct mindset. Pick a thing and stick with it, even if the internet decides it's not the best thing.
The problem is that every day a new library pops up and says "Hey, I don't like how we've solved this problem in the past, here's my slight offshoot of some other library." As in, the goal of Vue was to easily create UI-components that render quickly and does not assume anything about the rest of your stack. What else has the exact same goal? React. In my opinion, the solution to this problem is fork/fix/merge, not "I wrote a new library from scratch that has largely the same but slightly different syntax/paradigms/etc"
So, great, you love Vue, I'm happy for you. But Vue (and every other JS library) is not solving "JS fatigue" or fixing the ecosystem.
1
u/xxxabc123 Sep 21 '16
You're totally free to include the JSX transpiler in your browser
Yeah and keep getting annoying warnings in your console
React does not expect you to do any of that.
The ecosystem is clearly defined honestly. These are not required but I don't see beginner tutorial these days that don't add Redux / Jest / Router to the project. There a fuck ton of Medium posts out there missing the requirements of a beginner and just adding dependency after dependency, they're contributing immensily to at least my JS fatigue.
the solution to this problem is fork/fix/merge
If someone thinks they can do better, I'm fine with them inventing their own. Facebook didn't fix Angular or Backbone, they redefined their front end.
Pick a thing and stick with it
To be clear I am currently using only React in production, not Vue. I haven't used used Vue enough to love it, but I absolutely see their selling point. JS fatigue is not just about new libraries coming up and blurring the ecosystem, it's also about having a reasonably understandable API and not pull out your hair while you're debugging it.
0
Sep 22 '16
JS fatigue is not just about new libraries coming up and blurring the ecosystem, it's also about having a reasonably understandable API and not pull out your hair while you're debugging it.
0
u/xxxabc123 Sep 22 '16 edited Sep 22 '16
The blog you posted already mentions what I'm saying, so I'm not sure how you're rejecting my point.
Application developers should not have to become experts in the underpinnings of the library just to use it.
Seriously though, most JS libraries documentations are either very sparse or very broken. I don't have this issue when I'm working in Ruby or Objective-C/iOS ecosystems. I don't need to see the internals to understand what's going on while debugging.
Also, oh, someone else's Medium post that has lots of shares, I'm sure I'll take it as a definitive guide on JS fatigue and not have my own opinions /s
Edit: Found this following links from the Medium Post https://twitter.com/floydophone/status/680226147213426688
I think you can blame lacking docs, lacking tooling, over/underopinionated-ness of popular projects, etc
.
webpack was really hard for me to get down. I feel like docs are lacking. Still don't understand diff srcmaps
.
the tooling involved in most "modern" apps (react/redux/webpack/babel/etc) is pretty bonkers and involves a lot of arcane magic
0
Sep 22 '16
You're right, you're totally allowed to define any word or phrase however you want. I guess my point is you're not using the phrase as everyone else uses it, which is kind of the whole point of language in the first place.
13
5
u/GoTheFuckToBed Sep 20 '16
I use vue and I like it. Of course it is not the best or something, it still has quirks and gotchas. But the learning curve is ok and the tooling is ok. And the devs go into the right directions. (See change v1 vs v2).
6
u/Y_Less Sep 20 '16
I don't think they are. I started using it recently and reported a few bugs. Every time the response was "v2 will be out soon" or "v2 doesn't have that feature" - I wasn't reporting bugs in the next version, but the current one! They are doing the same thing as everyone else and abandoning support for their own code before the newer less capable version is even out. Fixes at least should be done for major versions for at least the next one major version.
2
4
u/miker95 Sep 20 '16
Someone correct me if I'm wrong, but jQuery is not designed to do the same things as easily or simply as React or Vue do, right?
They were designed for different things, as far as I see it. So why do people keep comparing two dissimilar things?
2
u/thebuccaneersden Sep 21 '16
No. jQuery wasn't designed to be be the same thing (or vice versa). jQuery is more of a selector engine, an extensible library and a plugin architecture. jQuery was originally designed to take a lot of the pain away from interacting with the DOM at a time where browser compatibility was crap and the code you wrote with one browser in mind would break on another.
React was designed with the intent for writing highly performant javascript applications by using a virtual DOM, rather than you interacting with the DOM directly.
VueJS is very similar in that regards. They are tools more suited for building front-end applications than jQuery is.
So, yeah, you are right. They were designed for different things.
I think the point the author was trying to make, however, is that the author thinks that if you are considering jumping on the "Reactive Components" train (ie. ReactJS), maybe you should consider VueJS instead because its easier to get ramped up on and is pretty solid - just like jQuery was when it gained popularity over its alternatives I guess.
3
u/Spartan-S63 Sep 21 '16
I tried Vue and I liked it in comparison to Angular. That said, I prefer React and Redux or Elm over Vue. It's just the habits that React and Redux (with immutable) or Elm enforce. I like functional programming paradigms and immutability better than imperative mutability because it makes you rethink the problem in a different way and it gives you nice guard rails while not making the problem too easy to solve or too slow to be competitive.
That said, Vue is a great framework introducing people to front end development. It's simple and does a lot of the things larger frameworks, like Angular, do without drowning you in the complexity.
4
Sep 20 '16
It seems as if the biggest argument is that JSX requires compilation.
This didn't stop TypeScript from growing a huge community. And TypeScript supports JSX out of the box, so you don't need Babel just for JSX.
TypeScript and JSX/React together provide so much value, the pain of setting up a modest compiler watch is negligible in comparison.
Additionally if learning curve is a problem, JSX doesn't recreate JavaScript by adding its own attributes for loops and conditions, an error too often repeated by templating systems. In JSX you can use plain JavaScript to build and map nodes. So JSX is a far easier thing to learn than Vue.
2
Sep 20 '16
It seems as if the biggest argument is that JSX requires compilation.
It's not that it requires compilation, it's that JS build tools required to make said compilation happen SUCK. I haven't used build tools this bad since a small game team I was on decided to write our own in python.
3
u/tmahmood Sep 21 '16
Why in the world I would want to compile JavaScript to JavaScript?!
7
Sep 21 '16
EXACTLY! If we're going to use JS as a build target, we might as well go all the way and use a language with static typing.
4
1
Sep 21 '16
Like TypeScript, which I mentioned in my first comment...?
2
Sep 21 '16
A language designed with static typing in mind from the start, not JS with a static type system bolted on top. Something similar to Kotlin, Nim or Swift, but that compiles to JS instead of the JVM or C.
2
u/FrozenOx Sep 22 '16
Yeah, that's pretty much Dart. Language designed to take over server side duties of Java, but a scripting language that easiliy compiles to JS. And it basically gets berated by the entire JS community, even though it has some of the best tooling out there. Dartium with the Dart VM in it lets you do hot reloads without compiling to JS. They're working on clean ES6 output, a TS definition > Dart converter, and incremental JS compile too. But it's community has largely plateaued and stagnated b/c of TypeScript.
2
Sep 21 '16 edited Sep 21 '16
I see, so welcome to a decade ago, when Delphi, C#, Basic and so on came out with JavaScript compilers. And Google had GWT that compiled Java to JavaScript. Those who don't know their history are doomed to repeat it.
Do you know why they failed? Because JavaScript doesn't exist in isolation. There's an ecosystem around it. Libraries written for JavaScript and APIs designed for JavaScript. Not to mention how reliant JavaScript is on dynamic data coming from servers and so on. Ignoring all this makes JavaScript a lot less useful.
This is why Microsoft abandoned their C#-to-JavaScript strategy in favor of TypeScript. And Google went with something closer to your ideal, Dart, and what came out of it? Nothing. Google's own libraries are written in TypeScript now (Angular 2).
TypeScript's type system is not simply "bolted on top" mind you. The type system reflects precisely the nature of JavaScript's implied types. This is why all the existing JS libraries can be expressed perfectly as TS libraries:
See this: https://github.com/DefinitelyTyped/DefinitelyTyped
You may want to dismiss TypeScript as some half-hearted effort, but it was designed carefully by the experienced minds who created Delphi and C#, so it only does a disservice to you to be so ignorant about it. I'm actually quite impressed at how well its design fits to JavaScript. I can't think of anything forced or leaky about it. It's natural.
1
u/FrozenOx Sep 22 '16
I wouldn't say GWT was a failure. And AdWords is written in Angular2 Dart now. There's actually a decent amount off Dart stuff in production, but it's mostly enterprise, huge application stuff. You're never going to see Dart gain JS users for just doing web work.
1
0
Sep 21 '16
build tools required to make said compilation happen SUCK. I haven't used build tools this bad since a small game team I was on decided to write our own in python.
Do you realize your comment is entirely void of information? What "sucks" in build tools? What is "bad" about them?
If you'll bother posting a comment, at least try to say something.
1
Sep 21 '16
Vue competes in the realm of green field applications, typescript in the opposite of that. Requiring a build process (compilation) isn't an issue when the entire purpose of typescript is to add static type checking.
0
Sep 20 '16
[deleted]
3
Sep 20 '16
But React isn't.
React is very simple. You write JSX, and you call ReactDOM.render(jsx, node) to render it in DOM. Everything else is optional, and I'd argue often unnecessary.
If you thought React is complex, congratulations. You just learned React.
Plus no matter how long I work with it, JSX always feels wrong to see in code, while .vue files at least give you a clear impression of concern separation.
JSX is a very thin abstraction over building a tree of objects that represent virtual DOM. It is code.
And while I can't do anything to change how you feel per se, always remember that concerns should be separated through architectural boundaries, not through syntactical ones.
Reinventing JavaScript like Vue does through "directives" and "filters" doesn't separate concerns. It just pointlessly introduces a "baby" version of features that already have a more flexible and mature alternative in JavaScript.
1
u/flukus Sep 20 '16
You missed all the compile steps and leaky abstractions, it doesn't look like vue suffers from these.
4
Sep 20 '16
Indeed I forgot all the leaky abstractions. Thanks for being so specific.
-1
u/flukus Sep 20 '16
You forgot about all the compilation steps turning what you code in into something other than what you debug in?
1
u/kagevf Sep 20 '16
source maps are your friend :)
0
u/flukus Sep 20 '16
Source maps are a patch on the leak. What about when things don't compile 1 to 1?
2
Sep 21 '16
Source maps are a patch on the leak. What about when things don't compile 1 to 1?
Do you even understand how debugging works and what source maps are?
It may shock you, but your browser doesn't run JavaScript code directly in its virtual machine, either. It compiles it to opcodes and machine code and uses an internal source map while debugging.
The source and the result are topologically the same. Nothing in JSX or TypeScript would arbitrarily refactor your code to something else the source map can't make sense of. So in that sense, it's all "1:1".
2
Sep 20 '16
heh i picture the new jquery as being better languages that i compile to js and use underlying concepts of react to help with the essentials
2
u/flukus Sep 20 '16
How does vue compare to knockout? It looks like another wheel reinvention.
And if that's the case, how does it replace jquery? Knockout and jquery have always worked well together.
1
1
u/dzecniv Sep 20 '16
Vue isn't comparable to Angularjs: «Vue.js itself is not a full-blown framework - it is focused on the view layer only» (the doc). Angular does async http calls, works with APIs easily, provides a testing framework, etc. Hello world in angular: https://angularjs.org/
I don't know React.
5
u/ejfrodo Sep 20 '16
Vue takes a modular approach instead of cramming everything into core, which IMO is better since you can choose to use Vue's router or you can use another one that you like better. Just Vue is based on the view layer, but it's got a router, an http client, a flux implementation, an async data loading plugin, etc, all official and by the Vue dev.
For testing, it just allows you to use the same testing tools that everyone else uses
2
1
u/thebuccaneersden Sep 21 '16
Angular does async http calls
Your browser already does this (XMLHttpRequest). I think what you are thinking of is two-way data binding?
2
u/xxxabc123 Sep 21 '16
No he means async http calls. No one wants to use deal with XMLHttpRequest directly for simple crud operations, so they use jQuery's Ajax calls or Angular's $http. Vue does not give you a full blown front end stack for stuff outside view operations such as Ajax
1
u/thebuccaneersden Sep 21 '16
Ah, ok. Well, I guess I never really thought of that as a selling feature for a framework. Angular has some more powerful selling points, if you are making the argument that it is a full blown framework vs something that isn't, in my opinion.
0
-12
3
Sep 20 '16
[removed] — view removed comment
5
u/peterxjang Sep 20 '16
Very true, the web development scene is vastly different than when jQuery took over, and the needs of the industry have changed greatly. But I do like to think that the web will always have a special place for beginners to get their first taste of software development. So many battle-hardened developers got their start long ago from seeing a cool website and inspecting its source.
I see jQuery as a tool that in some sense democratized the web even further, as it was indeed used by both beginners and professionals alike. I don't necessarily see that with React, Angular 2, etc., which are designed by giant companies solving giant needs. So many beginners come in wanting to use "real" tools, because it's kind of depressing to learn a "beginner" framework only to have to learn a new one that's more "professional".
So in this sense, I see Vue as a framework that has the same potential as jQuery to bridge the needs of both beginners and professionals. Perhaps I'm unrealistic in the sense of it's potential to win the same mindshare as jQuery, but as of now Vue is the framework that I recommend without hesitation to a beginner looking to get started in web development. I'm hoping that frameworks like Vue can keep the beginner-friendly spirit of the web alive.
2
u/jl2352 Sep 20 '16
Plus Prototype was shit. Like seriously, that's part of why jQuery won. Today's holy war is Angular 2 vs React. That's pretty minor compared to Prototype vs jQuery.
Prototype had
$(),$$(), and$F(), for selectors. It also had$A(),$H(),$R(), and$w(), which are totally unrelated. It added methods and properties to the in-built prototypes. It's utility methods, like Ajax, was more verbose. All of it was more verbose.For animations you had to use script.aculo.us. It was as shit as it's name, and the results looked as crappy as it's logo. Verbose API that ran badly. Many complex animations I had to do by hand with my own vanilla code because it was the only way to get them to run well.
jQuery had the nicest DOM API of the time. It had the nicest animations API at the time. It's API worked, and worked well. It did more, did it better, in less code, and that code was more readable. There is not a single redeeming feature about Prototype.
and then the killer feature ... plugins! jQuery would not be jQuery without the plugins. Every programmer and their dog has written a plugin for jQuery.
I remember on one of my first jobs I worked on a Rails site, and Rails used Prototype at the time. I would look at a page of code using Prototype and think "this could be replaced with 2 or 3 lines of jQuery." I ended up ripping Prototype and script.what.ever out, and that was the last time I ever used Prototype. Good riddance.
1
u/thebuccaneersden Sep 21 '16
You also forgot to mention cross-browser compatibility was a big deal back then.
(Also, I wouldn't call jQuery a framework...)
11
u/this-just_in Sep 20 '16
Vue.js is a fantastic mashup of React and Angular 1 with a growing community. However, jQuery is jQuery due to the overwhelming amount of developers out there who have used it. Vue.js is not the new jQuery, today. I question if we will see a new jQuery anytime soon.