views:

183

answers:

7

I current use prototype library to handle ajax requests. I have been on stack overflow for a week or so, and have seen lot of jQuery questions. It seems like most of people choose to use that library to handle javascript part of the programming. Beside the ajax part, rest of my javascript part on my website is developed on my own written code.

I am wondering if it would be more useful to continue to write my own javascript code, or should I spend time learning JQuery library and use its functions to save myself time? I am thinking that by writing my own code, it would make me more aware of the cross browser issues, and increase my understanding of javascript. On the other hand, if I just use the library and not deal with those issues, then there is no point in learning about them. Just kinda confuse and wanted to hear others opinions. What do others choose to do and why? How heavily do you rely on a library for JavaScript? How much more time would you need to spend, if you can make hypothetical guess, if you did not had the option to use the library?

I don't do any commercial work. I only work on my personal websites. (My functions collection, if it is helpful somehow in answering my question: http://hsbsitez.com/js/hsb_functions.js )

+3  A: 

People here will recommend jQuery, or other JavaScript libraries, by the "don't reinvent the wheel" logic. But, if you're making personal websites, it's sometimes quite fun to play with JavaScript yourself. Maybe reminding yourself that if you care about cross-browser issues, and are getting bored bug-fixing for different browsers, then jQuery (and other similar frameworks) does exist.

Dominic Rodger
+2  A: 

Well, if you enjoy writing javascript, and you like the challenge of working around the various cross browser problems, then stick with what you're doing. If javascript is just a facilitator to enable you to get a larger piece of work done, then there's huge value in leaning on a library/framework that's already abstracted a lot of the headaches away from you.

Steven Robbins
A: 

jQuery isn't the answer to all your questions. As a lot of other frameworks / apis and such there are stuff you want to do, but they're just not implemented or they just don't fit to the framework / api.

So why should you learn jQuery? Well, that my friend is easy; Why would you want to re-invent the wheel ( besides for learning purposes? ) ?

  • Use jQuery when you can

  • Use Own developed JS when NEEDED

Understanding concepts of frameworks and apis and knowing how to develope it yourselfe is never bad. But if you want productivity, use jQuery as much as you can.

Filip Ekberg
A: 

As someone just coming into web programming from years of desktop and backend development I've found jQuery to be a huge help. Letting jQuery deal with browser inconsistencies leaves me with one less thing to worry about.

As Scott Hanselman recently posted, stick to your core competencies and dealing with browser non-standards isn't one of mine.

Simon Hutton
+1  A: 

Why would you want to reinvent the wheel? Well if you don't know how the wheel works, you can't do much about fixing your wheel when it breaks, or making better wheels entirely - jQuery is an extremely useful tool, but don't ever let it be a crutch, and raw JS is the only way to learn.(1)

fwiw, I believe your personal website is the ideal opportunity to be learning on.

oh, and (stupidly blatantly obviously) this completely depends on the domain.

For a small localised problem, loading up a library is an unnecessarily expensive thing to be doing. For a large generalised set of problems the only efficient way to solve that, let alone the only sensible way to manage it, is to use a library of code - yours if it exists / is good enough / is well understood, jQuery probably being the best third-party library on the grounds of familiarity for other/future developers.

1. this is actually very debatable but my gut says JS -> jQuery will make obvious sense, but the reverse won't.

annakata
+1  A: 

Everyone using JavaScript should have done it on its own. And if just for the experience how difficult some things are.

But for professional use, I’d definitively recommend a JavaScript framework.

Gumbo
A: 

The ideal solution would be to use a framework like jQuery but to have a deep understanding of how it works. So when you do something seemingly basic with jQuery make sure to have a look behind the curtain to see what's really going on. I've learnt so much just from looking through the jQuery source code!

The first thing people will rave about is the cross-browser peace-of-mind that you get with jQuery - and everyone keeps on saying it's a massive minefield so we should leave it to the experts! It's really not that complicated - just have a look through the source code and you'll see (fortunately the jQuery team have been diligent enough to comment important snippets): http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.js

J-P