Vue.js is easier to learn than jQuery
medium.com
medium.com
Beginners want to make something happen. Like making alert windows pop up or (oooh!) modifying the text on a page. For these kinds of things, you actually don't need to know any of the underlying mechanisms. You just need to know that you put an id attribute on the thing you want to mess with and match it in the script. Similarly, throw the script at the bottom of the body, tell them to keep it there, and dispense with $(document).ready(). I haven't done the research (yet), but my experience tells me it's best to start people off somewhere in the middle of the ladder of abstraction, high enough that you can do something interesting right away, but low enough that you have some sense of the mechanism.
For beginners, brevity contributes to simplification. I used to write explanatory comments in scripts I gave my students. But their eyes don't parse the comments effectively, and therefore they perceive the comments as extra complexity. For this reason also, I would stick with jQuery.
But I'd love to find out. Anyone teaching intro CS who has time to run a comparison?
This surprised me as well, but 2 lines of code with 10 lines of comment gets a panic reaction while 4 lines of code is ok.
Yet, interestingly, people have very little problem understanding how spreadsheets work. This doesn't really argue against your point per se, but I think it makes for a plausible argument that you don't necessary want things to be imperative (jQuery) to be understandable.
EDIT: I do think presentation has a huge impact, and you really don't want explanatory commentary intermingled with a thing you're trying to understand. There's a reason we don't intermingle a single math formula/equation with comments inside the formula itself.
First, to answer OP's question, well the question is a little weird because i'd say that jquery supplements your vue.js app and makes it even more powerful. For instance, jquery provides methods like $.post() and $.get() along with a wide array of utility functions that you would typically use in your vue.js app.
But if you were comparing Vue.js to other frameworks like React, I'd say it's not only easier, it's a lot more fun to use and elegant (the same way jquery did for DOM several years ago). I would say always bet on elegance!
There is a horde of React developers who probably invested way too much time for them to move to anything else but my advice to them is once you go vue.js, you are probably not going to wanna go back, and hopefully that is a good thing.
React can be fun to learn in the beginning but over time it does cause a lot of fatigue when you need it to do a little more, which can overcomplicate your app rather quickly. So in my mind, I wouldn't be surprised if vue.js takes the lead over React anytime soon.
The complete separation of presentation and state with flux is a lot of work but starts to pay off when your data is used in many places and you can just connect any piece to the same global state and keep consistency. Or when you can make writing API interactions really easy with one middleware and from there your requests are done declaratively with actions.
I wonder what it's like to use Vue with Redux! Probably a bit weird given the two-way binding, where Redux is all about one-way binding and cycling every change through a global state transition. At first glance (revue, vue-redux) this seems awkward.
How does your team accomplish the stuff you would otherwise do with Redux? How do you do AJAX and how do you propagate that around? I suppose it's just like regular MVVM, all pretty isolated.
Also, Vue doesn't really have two way binding, just the v-model directive that is syntax sugar for handling an event to update component state.
I am an amateur developer (home projects) and started to use Vue which I find excellent. I had the idea, though, that using Vue and jQuery at the same time is not correct (= technically it works but it is not recommended as Vue is supposed to do the jQuery things. If you use jQuery then your Vue design is wrong. Again, this was my understanding). Except for AJAX where I use qwest anyway.
You want to avoid overlapping jQuery and Vue for areas both cover such as event binding and DOM manipulation. This should be left to Vue.
jQuery provides a number of other functions but AJAX is the major part of this.
See https://api.jquery.com/category/utilities/
If you already have a solution for AJAX, you might be interested in looking into a more generic library to complement Vue, such as Lodash https://lodash.com/
A quick example: http://colintoh.com/blog/lodash-10-javascript-utility-functi...
I think I've seen thousands of combinations for X and Y on HN. First everyone switched from JS to JQuery, Then JQuery to Ember or Backbone and never looked back. At one point everyone moved from Ember to Angular and never looked back. Then from Angular to React. Some people even switched from Swift and Java to React Native and never looked back. Then from Flux to Redux. And now I see people switching from React to Vue.js (and even back to JQuery?). And these were just for the Frontend JS libraries. It's all like a cat and mouse game. You cannot win. And I'm not sure there is even real progress. It seems like they are all reinventing the wheel again and again.
This also reminds me of Joel's article on "cover fire": http://www.joelonsoftware.com/articles/fog0000000339.html
I switched from Jquery to Angular 1, never went back. I switched from Angular 1 to React, never went back. I switched from React to Angular 2, never went back. I am considering Vue.js, and yes, I will never go back.
It's the developer version of the 24 hour news cycle. The many companies who are steadily and happily shipping valuable products on one stack aren't the ones that generate drama and pageviews.
Taking just one of your examples: the Ember ecosystem is large and growing, with many billion dollar businesses standardizing their apps on Ember. But that is too boring compared to "why we switched" posts.
"Everyone" turns out to be way bigger than "people you are likely to hear from on HN".
Could you elaborate on what extra things you'd like react to do for you?
That's kind of ridiculous though.
No one should be writing anything for the web without a basic understanding of how the DOM works, even if you wrap things like jQuery, vue.js or React around it.
It's not that complicated.
Every beginners tutorial should start with a basic introduction to the DOM, with some examples, and without ANY libraries.
Using jQuery here is pointless.
Here, without jQuery. How is using jQuery here with a beginner of ANY help?
<html>
<body>
<div id="output">0</div>
<button id="increment">Increment</button>
<script>
var counter = 0;
var output = document.getElementById('#output');
document.getElementById('#increment').onclick = function() {
counter += 1;
output.innerHTML = counter;
};
</script>
</body>
</html>But as Skywalker mentioned, node.querySelector() / querySelectorAll has been working well across browsers for a while and supports most expressions jQuery selectors would.
Need to create a complex UI or a single page app? Go for Vue or React. This list for me used to include Angular 1.x, ExtJS, jQuery UI, and many others.
<script>
var counter = 0;
$(document).ready(function() {
var $output = $('#output');
$('#increment').click(function() {
counter++;
$output.html(counter);
});
$output.html(counter);
});
</script>
with <script>
var counter = 0;
$(document).on('click', '#increment', function() {
counter++;
$('#output').html(counter);
});
</script>People who start at a very high level will take a very long time, if ever, to stop seeing the computer as a magic thing that 'does stuff somehow'.
That's how they actually get a feeling of what's underneath.
The browser APIs have become a lot more consistent and useful (querySelector was a biggie), you really don't need jQuery at the beginning.
It's a key thing to define a flexible structure when you are working on a complex project. It's supposed to be harder to learn Vue.js or similar things than jQuery since using such kind of frameworks you will probably be working on the complex project, so you will have to use your brain to define a proper app structure, to keep code base maintainable, to conduct a refactoring, etc.
I am using vue.js and vuex in some of my current projects. Only problem for me is that after adding Vuex and all it's getters, mutations and actions, my Vue component code now looks like lot of boilerplate code. Did any one else had that feeling. Is there any way I can directly connect vue template with vuex without intermediate component?
Vue.js requires a lot of different concepts that many developers have never run into before. There are multiple parts working together. It is tremendously more difficult to understand (though only on relative terms, no absolute).
Lesson 2: No. There're not enough Vue.js plugins in the wild. You can't play with fancy stuff. No more joy.
Lesson 3: No. You will find hard to understand the bundled NODEJS tools on articles and the way to use libs.
Comparing the two is ridiculous. They both have different aims and use cases.