JQuery - Should I use it?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

JQuery - Should I use it?

Post by Chalks »

I like the idea of JQuery and I know it cuts development time down. However, I am not extremely fluent in Javascript and I'm afraid that learning to use JQuery will hinder my knowledge of what's happening when I do certain things (AJAX in particular). I guess my question is this: Should I learn how to manually do the things that JQuery does for me before I start using it?
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: JQuery - Should I use it?

Post by alex.barylski »

Everything that jQuery does you would *never* want to do in plain JavaScript as it's a PITA. You use jQuery to effectively and easily work with the DOM. JavaScript as a language itself could operate without the DOM but wouldn't be very useful.

The only things you need to learn javascript for is maybe advanced control development.

Learn jQuery yes...and JS while your at it. ;)
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: JQuery - Should I use it?

Post by Christopher »

Yes.
(#10850)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: JQuery - Should I use it?

Post by s.dot »

I suppose you should learn it the long way so you know the ins and outs of it. But JQuery speeds things up so much! I love it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: JQuery - Should I use it?

Post by Christopher »

Should any of us really had to learn the long way in Javascript? ;)

I have this feeling when using these libraries since Prototype that they should have built Javascript that way from the start ... if only they had known.
(#10850)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: JQuery - Should I use it?

Post by alex.barylski »

I have this feeling when using these libraries since Prototype that they should have built Javascript that way from the start ... if only they had known.
The way the DOM is manipulated using jQuery is far better than using the getElementById()
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: JQuery - Should I use it?

Post by JAB Creations »

Subjective to what you're working on. If you're working on an American site a surprisingly large portion of people here in America are still connected through dialup due to DSL/Cable companies not spending the money to connect people who don't live in clustered communities whereas in South Korea and Japan for example it's common to have a 50+ megabit internet connection. I'm not sure about Europe (but I know their speeds when they do have them absolutely kill American "high" speed.)

Will you compress jQuery? What percentage of your visitors are using dial up? How much research have you put in to this equation? Roughly one tenth of my site's visitors (from very a very relaxed observation) choose my site's dial-up entrance (could be much higher or lower with indepth analysis.)

I use jQuery only as an opt-in option. It is really nice but it's time has not come for several reasons...

1.) Too many people here blindly push JavaScript libraries without considering what percentage of people still use slow connections.

2.) Using a library locks you in to learning just to program to that library. It locks you out of learning how to program this stuff yourself.

3.) What percentage of that library will you actually utilize? They've downloaded several dozen kilobytes and you're utilizing perhaps 4-20KB of that for example?

I don't want to ruin the party but someone has to keep things balanced around here. :wink:
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: JQuery - Should I use it?

Post by pickle »

You should definitely learn the basics of javascript before using a library. ~JAB made a good point that if you just learn the library, you're stuck with that library. It's best to have a skill that'll last you for a while & allow you to learn the current en vouge library.

While there are some fancy things that libraries allow you to do much quicker than rolling your own (ie: animations), I don't think you need to know how to do those things perfectly, though you should have an idea of how they work.

Finally, no library is perfect. I love jQuery & it's helped me spruce up my interfaces quite often. There are times though, that I've had to use document.getElementByID(), rather than a jQuery selector, simply because it was faster. Without knowledge of Javascript, I'd be left to the whims of the jQuery developers & my interface wouldn't be as good as it can be (no, I don't work for the US Army ;) ).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: JQuery - Should I use it?

Post by alex.barylski »

Subjective to what you're working on. If you're working on an American site a surprisingly large portion of people here in America are still connected through dialup due to DSL/Cable companies not spending the money to connect people who don't live in clustered communities whereas in South Korea and Japan for example it's common to have a 50+ megabit internet connection. I'm not sure about Europe (but I know their speeds when they do have them absolutely kill American "high" speed.)
Really? Weird. I wonder why that is. Most people in Canada are on high speed. Even cities with heavy urban sprawl. I would say 85% are high speed. I can't see the number being much less in the States, then again you have 10 times the population...
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: JQuery - Should I use it?

Post by pickle »

Last figures I heard were from 2006 & the figure was about 50%.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Re: JQuery - Should I use it?

Post by m3mn0n »

I get free dial-up access with my high speed and make sure to test out my sites on that. I've noticed my jQuery usage works and loads fine. Not too slow at all.

I can understand this argument for *heavy* Ajax usage or a lot of image manipulation, but for any/general usage of jQuery, I don't really see how much significance connection speed has. It sounds like you're talking about a Flash intro and not a tiny/lightweight JS library. ;)
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: JQuery - Should I use it?

Post by Chalks »

Thank you guys for all the input. JAB really pointed out what I'm worried about:
2.) Using a library locks you in to learning just to program to that library. It locks you out of learning how to program this stuff yourself.
I think I'll stick with just programming the javascript myself for now since there are a few things that I'm still very shaky on (xmlhttprequest). I really do like the idea of jquery though, and will _definitely_ use it soon. Debugging javascript so that it works in IE and FF the same way is quite a pain and I'll be glad to eliminate some of that headache... eventually.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: JQuery - Should I use it?

Post by Christopher »

I really don't think learning old school Javascript is very worthwhile. All the the modern libraries are very similar in their implementations. I switch between Prototype, jQuery and mootools with little problems.

The giant increase in productivity and the ability to do things quickly that you will probably never be able to do yourself, far outweighs any sort of benefit you will get from doing it the hard way. Do you care how the internals of PHP string or array or XML functions work? Knowing the tedium of DOM traversal and intricacies of Javascript quirks really won't make you a better person. Life is too short to not do the cool stuff that these libraries make easy.
(#10850)
User avatar
volomike
Forum Regular
Posts: 633
Joined: Wed Jan 16, 2008 9:04 am
Location: Myrtle Beach, South Carolina, USA

Re: JQuery - Should I use it?

Post by volomike »

Count me in as a tremendous fan of jQuery. I've been using it on several projects and yes it saves time and testing time. So, yes, learn it because it's worth it. However, I wouldn't attempt to learn it if you haven't gotten a fairly good grasp of Javascript, first.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Re: JQuery - Should I use it?

Post by Kieran Huggins »

arborint wrote:Yes.
Image Second.

Also, keep your ears peeled for JABL ;-)
Post Reply