Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Foundations Strings Methods: Part 1

JavaScript vs Jquery. Folks say JQ is easier, but...

I've read on Stack Overflow that JQuery is easier, but it doesn't mean that you know JavaScript or that you're any good at debugging, making it sound like a glorified shortcut.

If this is the case, does it make sense to stick to studying JS until you've suffered enough, paid your dues, and get pretty good at it and then turn to studying JQ? So you won't get lazy?

4 Answers

Richard Duncan
Richard Duncan
5,568 Points

The first thing here I would say is that jQuery is not a substitute for Vanilla JS. It's a tool that aids more rapid development of applications. If you want to animate a menu or select some elements to change on the fly then jQuery is a great choice for that. Also if you're looking to develop plugins to share with a community I would go with jQuery.

If you want to manipulate the canvas to say draw a pie chart using math then you're going to use JS theres no avoiding it. Another example may be writing a clock, you could extend the native Date method in JS to enable you to achieve this but there is no alternative in jQuery.

jQuery is written in JS and will handle a lot of backward compatibility issues associated to different browser versions which can be really useful and may make your code more succinct. The flip side of this is you need to include the jQuery library to enable this. You may not want dependancies on third party software or you may have restrictions on bandwidth that make your pages load more slowly when you include jQuery.

I like both and ultimately anything that can be done with jQuery can be done in JS but not everything that can be done with JS could be done using jQuery core methods. Ultimately it's down to time, preference/comfort and usability. Weigh up your requirements and make a decision. I would think for most people jQuery is a viable option for what they want to achieve.

The great thing with jQuery being written in JS means that you can use both together and will often find yourself doing so where jQuery core methods don't supply the functionality that you need.

Vanilla JS is hard to learn no doubt. But like anything that is difficult to do the rewards are great.

Hi Ron,

Don't quit JavaScript; but a diversion might add some encouragement. You're most likely here to learn web design and jQuery is for the web.

jQuery Basics at Treehouse

TRYjQuery.com

Jeff

Thanks Jeff,

But what are your thoughts on what the Stack Overflow elitists are saying, that JQ can lead to a sloppy JavaScripter?

And, I'll take your advice. By the way, JS is my first program language (and I don't want to hear any of yous saying it's not a program! And that it's a script language!!) having only learned HTML & CSS. CS majors say it's best to start with Python and/or Ruby, but as you said, my focus is web design and ecommerce.

Any additional suggestions are more than welcome. Thanks again.

Excellent answer Richard. Thanks. This helps explain a lot. I'll share with my other JS (first program) sufferers.