Slashdot Mirror


To Learn (Or Not Learn) JQuery

Nerval's Lobster writes: jQuery isn't without its controversies, and some developers distrust its use in larger projects because (some say) it ultimately leads to breakage-prone code that's harder to maintain. But given its prevalence, jQuery is probably essential to know, but what are the most important elements to learn in order to become adept-enough at it? Chaining commands, understanding when the document is finished loading (and how to write code that safely accesses elements only after said loading), and learning CSS selectors are all key. The harder part is picking up jQuery's quirks and tricks, of which there are many... but is it worth studying to the point where you know every possible eccentricity?

126 comments

  1. Learn jQuery by Anonymous Coward · · Score: 1, Informative

    It's awesome, and a lot easier than learning all of the eccentricities of plain old JavaScript.

    1. Re:Learn jQuery by Nimloth · · Score: 3, Insightful

      I agree, but there is a balance you should achieve. When I first learned jQuery and realized how easy it was to do a lot of things, I went crazy with it. Nowadays I've realized most of what I was using jQuery for, was better done using minimal jQuery (or none at all) and more CSS. Yes, it would be possible to use plain old javascript, but it's easier to write, AND READ jQuery than it would be to script all browser-specific perks of javascript. At the end of the day, use it, but don't abuse it. It's cached on all client browsers anyway and processing overhead and minimal, might as well use it and save yourself a headache or two.

    2. Re:Learn jQuery by jasonridesabike · · Score: 2

      Same here. Overused it after just starting and now am moving on to a more powerful albeit all encompassing framework (Angularjs specifically). I still use jquery in non-angular projects as a time saving measure when for whatever reason I'm forced to keep hours low; I'm freelance and occasionally have to stick to quotes. But for animation and effects nearly always use CSS3 exclusively, it's hw accelerated and now widely supported enough to rely on. It was and still is a nice pair of training wheels and still has a place in time constrained projects.

    3. Re: Learn jQuery by Anonymous Coward · · Score: 0

      Has someone made a blocker script yet for Nerval Lobster's Dice ads?

    4. Re:Learn jQuery by jasonridesabike · · Score: 1

      It's great to start out and become productive quickly, but ultimately a web developer needs to learn those eccentricities if they want to work on more complex and interesting projects. jQuery is a good stepping stone.

    5. Re:Learn jQuery by Hognoxious · · Score: 4, Funny

      JavaScript guru, you say? Impostor, say I!

      Your percentages add up to 100.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    6. Re: Learn jQuery by cyber-vandal · · Score: 1

      It's not the simplest concept to get your head around and is not something you'd use a lot.

    7. Re:Learn jQuery by JustAnotherOldGuy · · Score: 1

      Bingo. I love jquery for several reasons, not the least of which is that it provides simple ways to do common things without having to cook it all myself over and over.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    8. Re: Learn jQuery by Anonymous Coward · · Score: 0

      Sometimes cooking it yourself can be better. At least if something goes wrong with the stew you know where to look for the problem.

    9. Re:Learn jQuery by mrbester · · Score: 1

      "What does .bind() do?"

      In old IE it throws an error.

      --
      "Wait. Something's happening. It's opening up! My God, it's full of apricots!"
    10. Re: Learn jQuery by Anonymous Coward · · Score: 0

      I like seeing the pic of Kate at the top of the page. Perhaps one of the few times when there is an incentive not to block ads.

    11. Re: Learn jQuery by Anonymous Coward · · Score: 0

      Now of course, if you had used jquery's .proxy() ...

    12. Re:Learn jQuery by Anonymous Coward · · Score: 0

      Whatever you define it to do because fuck prototypical languages.

      > Makes developers oblivious to the underlying language.

      That's a good thing, and partially the point of jQuery (to hide the ugly parts). The underlying language has crummy inexplicable mechanisms...what other prototypical language has bind? oh it's yet-another-custom-javascript-thing? Not surprising.

    13. Re: Learn jQuery by Joce640k · · Score: 1

      At least if something goes wrong with the stew you know where to look for the problem.

      Really?

      The last update to jQuery was to fix "a timing bug in iOS8 that causes mobile Safari to incorrectly report a 'length' on objects that don't have one."

      Ref: https://github.com/jquery/jque...

      You'd have known 'where to look' for that and been able to fix it, right?

      --
      No sig today...
    14. Re:Learn jQuery by Daniel+Hoffmann · · Score: 1

      Well it would help if you said Function.bind()...

    15. Re:Learn jQuery by slashdice · · Score: 1

      #fail. It fixes DOM problems, not javascript problems. I mean, if you're dirtyt, can you clean yourself off by smearing shit all over yourself? Of course not. So how can a javascript library, written in javascript, fix deficiencies in the javascript language? It can't. You need to use a transpiler like coffeescript or babel if you want to improve the javascript language.

      --
      Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
    16. Re:Learn jQuery by Anonymous Coward · · Score: 0

      I think you meant to ask what Function.prototype.bind() does instead of the ambiguously labeled .bind(). Part of your problem is thinking that the rest of the world is stupid when you just don't know how to ask a question intelligently.

    17. Re:Learn jQuery by JourneymanMereel · · Score: 1

      So what does it do?

      $ is just an alias to the jQuery object (so, as I recall, $.bind() is equivalent to jQuery.bind()...) which would mean that $.bind() is not the right answer (without even using the fact that you asked the question as a hint to what the answer is).

      --
      Life has many choices. Eternity has two. What's yours?
  2. It is essential to know? by Anonymous Coward · · Score: 0

    So if I work on, say, Linux kernel issues, it is essential for me to know about jQuery?

    1. Re:It is essential to know? by Anonymous Coward · · Score: 5, Funny

      Most of the Linux kernel is based on jQuery.

    2. Re:It is essential to know? by bytesex · · Score: 1

      Linus Torvalds himself created, and then ported to jQuery, the entire kernel source code. Or so I've heard.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    3. Re:It is essential to know? by Anonymous Coward · · Score: 1

      It's all angular JS now. Everything.

    4. Re:It is essential to know? by Anonymous Coward · · Score: 0

      Al Gore invented the Internet. Without Albert, we'd have no jQuery or Slashdot. Although I'm beginning to think I can do without Slashdot.

    5. Re:It is essential to know? by Hognoxious · · Score: 4, Funny

      That's last year. It's been replaced by systemd.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    6. Re:It is essential to know? by tlambert · · Score: 1

      That's last year. It's been replaced by systemd.

      Is systemd written in JQuery?

    7. Re: It is essential to know? by Anonymous Coward · · Score: 2, Informative

      No, it's written using other systemd APIs. It's systemds all the way down...

    8. Re:It is essential to know? by JustAnotherOldGuy · · Score: 2

      And he did it in assembly, on an Atari 800, blindfolded, in the dark, in a cage full of venomous snakes and sharks.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    9. Re:It is essential to know? by JustAnotherOldGuy · · Score: 1

      Is systemd written in JQuery? Of course.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    10. Re:It is essential to know? by Anonymous Coward · · Score: 0

      and typing with his penis.

    11. Re:It is essential to know? by Anonymous Coward · · Score: 0

      Why'd it have to be snakes?

    12. Re:It is essential to know? by rcase5 · · Score: 1

      Yes!

      And Julia Child prepared an entire Thanksgiving dinner, with all the fixings, using nothing but a cheese grater.

  3. Useful once, now kind of redundant by pushing-robot · · Score: 3, Informative
    --
    How can I believe you when you tell me what I don't want to hear?
    1. Re:Useful once, now kind of redundant by Anonymous Coward · · Score: 0

      Redundant to what? Bare JavaScript?

    2. Re:Useful once, now kind of redundant by Anonymous Coward · · Score: 0

      Like a certain web site.

      Now I'm kind of looking forward to the August article questioning if jQuery is still worth it.

    3. Re:Useful once, now kind of redundant by nickittynickname · · Score: 1

      Till all very commonly used browsers treat javascript the same way there will still be a place for jQuery. It may be a time now for something more light weight.

  4. Not all programmers are web frontend devs by bulled · · Score: 4, Insightful

    This is another in a long chain of articles that seem to assume all developers work on web frontend software. We do not. I have no use for jQuery and thankfully do not have to work on a single line of JavaScript in my day job. Maybe if you want to work on frontend-y stuff then it would be worth learning, but it is by no means required to be a developer.

    1. Re:Not all programmers are web frontend devs by Shortguy881 · · Score: 1, Insightful

      frontend developers

      Isn't that an oxymoron?

      --
      Brilliance without wisdom, power without conscience. Ours is a world of nuclear giants and ethical infants.
    2. Re:Not all programmers are web frontend devs by Anonymous Coward · · Score: 2, Informative

      You assume that Javascript is front-end
      That is no longer the case

    3. Re:Not all programmers are web frontend devs by Hognoxious · · Score: 2

      It's no more an oxymoron than UX designers.

      Umm, hang on ...

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    4. Re: Not all programmers are web frontend devs by Anonymous Coward · · Score: 0

      Can you nme ONE use of jQuery outside of client side development ?

      I can't. Node.js does nothing to change this.

    5. Re:Not all programmers are web frontend devs by Anonymous Coward · · Score: 0

      And what does this fact have to do with jQuery?

    6. Re:Not all programmers are web frontend devs by Tablizer · · Score: 1

      I don't really understand your gripe. Slashdot covers many technology specialties. Very few article topics will fit the entire audience, and many will fit only a small subset. That's expected. I've seen embedded programming articles also, for example, which a web developer will typically not care about. Should web developers gripe about articles on embedding?

      You seem to have a set of unstated assumptions about the domain of slashdot and the domain of its readers that doesn't match mine. Perhaps you are arguing there are too many articles related to web development compared to other domains. But web development is a large and growing domain such that it's a frequent area of change and growing pains, which is usually what "news for nerds" would cover. You don't see many articles on the COBOL language because it no longer changes very often, for example. That's not necessarily a bad thing; but it doesn't generate "news".

    7. Re:Not all programmers are web frontend devs by Tablizer · · Score: 1

      We really need a better term for "back-end developers", for what should be obvious reasons. Nerds have enough social cred problems as it is. Sometimes "server side" is used, but that doesn't quite cut it because some UI dev is also done on the server side in many cases.

    8. Re:Not all programmers are web frontend devs by murdocj · · Score: 1

      God help you if you are using JS on the back end. It's bad enough on the front end.
      But I do love jQuery.

    9. Re:Not all programmers are web frontend devs by khellendros1984 · · Score: 1
      It sounds like a gripe about the wording in the summary:

      But given its prevalence, jQuery is probably essential to know,

      It's clear enough that they're talking about web UI development, but when do you not hear someone complaining about assumptions made in the summary?

      --
      It is pitch black. You are likely to be eaten by a grue.
    10. Re:Not all programmers are web frontend devs by mwvdlee · · Score: 1

      Some of us are, some of us aren't and some of us are both or even neither.
      This site is not "News for me, nothing else matter".

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    11. Re:Not all programmers are web frontend devs by Anonymous Coward · · Score: 0

      No, but it should be.

      Node.js is poopoo.

    12. Re:Not all programmers are web frontend devs by luis_a_espinal · · Score: 1

      You assume that Javascript is front-end That is no longer the case

      Irrelevant to the topic at hand, JQuery (and front web development specifically which is the article's theme.)

      This is like having a discussion on C/C++'s direct memory management and then drop a retort saying "you can get automatic garbage collection" with a link to Microsoft's C++/CX. #duh

  5. Don't be fooled by frovingslosh · · Score: 4, Funny

    No matter what they tell you, last Friday's Supreme Court ruling does not say that straight people must accept JQuery.

    --
    I'm an American. I love this country and the freedoms that we used to have.
    1. Re:Don't be fooled by Shortguy881 · · Score: 1

      I was running sentiment analysis on some articles and there impact on stock prices. The word "JQuery" had a 100% negative correlation with stock prices. Seems fitting.

      --
      Brilliance without wisdom, power without conscience. Ours is a world of nuclear giants and ethical infants.
    2. Re:Don't be fooled by chetbox · · Score: 1

      I personally lean towards jQueery

  6. Re:Greek to default on debt owned by Anonymous Coward · · Score: 0

    Just one Greek?

    Well, that's good to know, for a while there we were worried that the entire country of Greece was going to collapse. That would have been quite a crisis!

  7. In all the time spent asking the question... by Anonymous Coward · · Score: 0

    You could be learning already. It's free! Nothing is stopping you.

    Share this post! The link labelled "Share" is there for a reason ya know!

    1. Re: In all the time spent asking the question... by Anonymous Coward · · Score: 0

      Another silly person asking a silly question. Jquery ain't nothing to learn and use. A good programmer should have no issue picking up the foundations of JavaScript in a weekend. I'm using mootools in a current project - there is a website with docs. One should be proficient in a couple of hours or are you in the wrong profession or do I just not get paid enough.

  8. essential to know about jQuery by Anonymous Coward · · Score: 1

    Do NOT use a hosted library. If you have to use it, copy the damn thing to your own server.
    Hosted libraries, especially massively used ones like jQuery, are a security disaster waiting to happen.

    Not to mention the privacy issues caused by using a library hosted by a company that is known to correlate every bit of information about people that they can get their hands on (Google)

    1. Re:essential to know about jQuery by JustAnotherOldGuy · · Score: 1

      ^^^^^ THIS, times a billion.

      Hosting your own libraries bypasses a slew of potential security holes. I never do it any other way, ever. I wish I points to mod you up. Maybe someday, lol.

      --
      Just cruising through this digital world at 33 1/3 rpm...
    2. Re:essential to know about jQuery by lucm · · Score: 2

      There is a performance aspect to consider, however, especially on mobile where the network sucks. It's very likely that people would already have the CDN version in their browser cache since a lot of website use that link. By forcing users to download your version, you are slowing things down for them at the worst possible time - their first visit to your website.

      If you have valuable content and a captive audience, fine, but if like most people you are in dire need to attract and retain visitors, it's best to put chances of doing a first good impression on your side. Use the google hosted version and keep an eye on things.

      --
      lucm, indeed.
    3. Re:essential to know about jQuery by Anonymous+Brave+Guy · · Score: 1

      It's very likely that people would already have the CDN version in their browser cache since a lot of website use that link.

      This is a popular claim, but what little real data I've seen says quite the opposite. There are so many different minor versions of a library like jQuery that the chance of any given visitor to your site actually having visited another site using the exact same version from the exact same CDN within the cache window turns out to be pretty low.

      There are still reasonable performance-related arguments in favour of hosting static content on a CDN, and for splitting resources across domains unless you're in SPDY or HTTP/2 territory, but those aren't quite the same issue and you can avoid them without resorting to loading libraries from third party hosts you don't control.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    4. Re:essential to know about jQuery by lucm · · Score: 1

      It's very likely that people would already have the CDN version in their browser cache since a lot of website use that link.

      This is a popular claim, but what little real data I've seen says quite the opposite. There are so many different minor versions of a library like jQuery that the chance of any given visitor to your site actually having visited another site using the exact same version from the exact same CDN within the cache window turns out to be pretty low.

      There are not that many version of jquery in use, and anyways the odds of that same visitor having your local version on his first visit are ZERO, which is basically the worst case scenario. Given the fact that this is a third-party library that you are unlikely to modify, hosting it on your own servers provides no advantage whatsoever. Just monitor the CDN like you do for your own resources.

      --
      lucm, indeed.
    5. Re:essential to know about jQuery by Anonymous+Brave+Guy · · Score: 1

      Given the fact that this is a third-party library that you are unlikely to modify, hosting it on your own servers provides no advantage whatsoever.

      Of course it does. It has the same advantages in terms of security and your visitors' privacy as any decision to host your own material instead of quietly using a third party service. Whether you consider those significant advantages is a different question, and whether your visitors would is a different question again, but clearly there is a difference.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  9. Just get familiar with it by MikeRT · · Score: 1

    I don't know about other toolkits, but Angular uses it for a number of tasks. There's a lightweight clone, but plugging in jQuery to replace that is very common. I've used jQuery with ExtJS as well because Ext's equivalent was pretty bad (as of 3.X and 4.X) for doing straight forward DOM access. Learn the very basics of querying the DOM with it and adding new elements, then move on.

  10. There will always be something better by Kagato · · Score: 1

    Front end browser development is littered with dozens of front end frame works that have fizzled over the years. YUI, Prototype, script. aculo.us, etc. All popular in their day. jQuery is still active but certainly on the decline.

    You want to be a good front end developer? Learn about the DOM model. Learn about HTTP, HTTP/2 and CSS. Learn the fundamentals of how all that stuff works together and then you'll never need to worry about picking up whatever front end framework is used by the cool kids.

    1. Re:There will always be something better by SirJorgelOfBorgel · · Score: 2

      To be fair, back in the day browsers were a lot more quirky and getting even simple scripts to work in the big five was a major hassle. These frameworks took a lot of that away. These days, that issue is much less prevalent.

  11. JavaScript developers still clueless by Anonymous Coward · · Score: 0

    ASP supported JavaScript back in 1999.

    Netscape Enterprise also supported server side JavaScript. IIRC is may have needed a plug-in.

    1. Re: JavaScript developers still clueless by Anonymous Coward · · Score: 0

      Look at where that got em'. You can always run node too but real environments use real languages. Untyped languages are a disaster waiting to happen.

  12. Define controversy... by SirJorgelOfBorgel · · Score: 5, Insightful

    Back when I did web stuff a number of years ago, we used jQuery pretty extensively. I've even been involved a bit, submitted performance patches, etc. (none of the code I touched is still present though). Having used other javascript toolkits, jQuery was by far my favorite (I still have nightmares about Dojo). Made a lot of things very easy that were otherwise cumbersome, lengthy, or errorprone to do. Note that when I say jQuery here I mean the core of it, not the UI components and such that came later.

    I've actually read the linked articles (*gasp*), and it seems the one referenced to imply that developers distrust it in large projects (really, summary?) is simply elaborating on how they have been using jQuery in a way that doesn't work very well, and found a different way of using it where it does work well. Surprise, jQuery is a tool, and crafting solutions requires you to use the right tool, in the right way, at the right time. Screwdrivers are great for screws, but nails pair better with the hammer.

    jQuery is a very helpful tool if you use it right, and I think it would be beneficial for most javascript developers to have played around with it. It's not all that complicated, it's easy to learn, and if you're javascript is novice level, figuring out how/why jQuery works will also improve your javascript skills significantly.

    I haven't heard of any other controversy regarding jQuery either but I haven't really been paying attention to it lately. Anyone care to elaborate?

    1. Re:Define controversy... by Anonymous Coward · · Score: 1

      The controversy is there are all these new hotness JS frameworks that need jQuery market share.

    2. Re:Define controversy... by Anonymous Coward · · Score: 0

      OP did define controversy. He said "some say". That's all you need.

    3. Re:Define controversy... by Intrepid+imaginaut · · Score: 1

      I mix and match jQuery and Javascript freely, there's no reason you can't use it in places where it works well, although my default is Javascript, which itself is not without its little quirks - like when you try to sidestep the client-server push model without AJAX and discover JS doesn't do line breaks in variables. Can you say concatenation on an industrial scale?

    4. Re:Define controversy... by Anonymous Coward · · Score: 0

      I mix and match jQuery and Javascript freely, there's no reason you can't use it in places where it works well, although my default is Javascript, which itself is not without its little quirks - like when you try to sidestep the client-server push model without AJAX and discover JS doesn't do line breaks in variables. Can you say concatenation on an industrial scale?

      When you say "Javascript" I suspect you actually mean "DOM".

    5. Re:Define controversy... by Dynedain · · Score: 2

      Exactly.

      If you're browser-side JS developer (as opposed to something server-side like Node.JS) and you haven't worked with JQuery, then you're not really a browser-side JS developer. It's just far too widely used to pretend that it doesn't or shouldn't exist. And most of the consistency across other frameworks (like using the $ shortcut or css selectors to target elements in the DOM) comes from the popularity of JQuery to begin with.

      --
      I'm out of my mind right now, but feel free to leave a message.....
    6. Re:Define controversy... by quietwalker · · Score: 1

      Put more succinctly than I could. It's a popularity contest, little more.

  13. Obligatory post in a jQuery topic ... by Misagon · · Score: 1, Offtopic

    Anyone who is considering learning jQuery should also check out Vanilla JS.

    Vanilla JS is a fast, lightweight, cross-platform framework for building incredible, powerful JavaScript applications.

    --
    "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
  14. Don't learn it by YoungManKlaus · · Score: 1

    Just look it up whenever you need something. Separating learning and using is such an outdated concept.

    1. Re:Don't learn it by Anonymous Coward · · Score: 0

      Hah. I feel sorry for people who really think the way you do. On the other hand, being able to come up with resourceful and innovative solutions is basically a complete liability in this day and age.

  15. Complex DOM Manipulation by Daniel+Hoffmann · · Score: 1

    If you need to perform complex DOM manipulation jQuery is still the best tool, fortunately recent javascript frameworks drastically reduced the need for manual DOM manipulation. Usually you encapsulate your jQuery DOM manipulation code using your framework of choice, this is very common when doing specialized UI components.

  16. Learn Why and How jQuery does what it does by jimmifett · · Score: 1

    I personally don't like jQuery for various reasons, but if one is going to use it, learn the why's and how's, so that when things aren't working, you can figure out why.

    Myself, I use ExtJS heavily for projects on the front end, granted i'm doing things that actually have a purpose for business.

  17. Vanilla JS by Ark42 · · Score: 0, Offtopic

    http://vanilla-js.com/ is probably much more worth learning and using. The *ONLY* reason to be using jQuery is for IE8 support, but I've long since required IE9+ for all freelance work I do, and do everything in CSS and Vanilla JS now.

    1. Re:Vanilla JS by Anonymous Coward · · Score: 0

      http://vanilla-js.com/ is probably much more worth learning and using. The *ONLY* reason to be using jQuery is for IE8 support, but I've long since required IE9+ for all freelance work I do, and do everything in CSS and Vanilla JS now.

      This always sounds to me like a story from The Onion: "Area Programmer Constantly Mentioning He Doesn't Use JQuery"

      http://www.theonion.com/articl...

    2. Re:Vanilla JS by Anonymous Coward · · Score: 0

      It's a lucky freelancer who gets to specify the browser compatibility requirements of their projects...

    3. Re:Vanilla JS by Anonymous Coward · · Score: 0

      Not really. I've pretty much yet to meet a client who doesn't just go by Current and Current-1 as the target versions for any given browser, or at the very least, versions that are still supported by Microsoft (being IE9+ anyway). The reality is most of the time I can target IE10 as the minimum, and nobody cares about anything other than IE, Chrome, Firefox, and iOS.

  18. Re:Obligatory reply to a vanillaJS post by LordKronos · · Score: 1

    Anyone who is considering learning jQuery should also check out Vanilla JS.

    Vanilla JS is a fast, lightweight, cross-platform framework for building incredible, powerful JavaScript applications.

    I love it every time "Vanilla JS" is brought up in a jquery post. Please see my previous post on the topic, which demonstrates why that website is both dishonest in its comparison, as well as a perfect example of why you should use a proven library instead of reinventing the wheel (and all the bugs that come with said reinvention)

    http://slashdot.org/comments.p...

  19. Sure why not, but who cares? by Anonymous Coward · · Score: 0

    Really? A big decision to learn a library? I learned jQuery in like a week and wrote a full mobile app in 3 weeks that used it. It was ok. It was kinda better than plain javascript, but only sometimes. It's a freaking web hack script language. There are a zillion of them, all equally kinda useful, kinda useless, full of crappy tricks you learn as you need to. It's no big deal, you don't even have to know how a computer works to get an app running. So sure, why not learn it. It doesn't take long, and it's kinda useful if you really have to write another broken web app. /shrug

  20. Just learn JavaScript by Anonymous Coward · · Score: 1

    Because today someone will say Angular is the way to go. Tomorrow they will say something different. Web development is a big joke.

  21. jQuery makes a nice introduction to javascript by quietwalker · · Score: 5, Insightful

    If you're doing front end web development, at some point, you're going to have to become good at Javascript.

    You've got all these different frameworks where everything gets abstracted 3 redirections deep into a pseudo MVC layer populated with promise events and callback system that work well for 80% of the job and make 20% incredibly hard, and STILL in the end ties into the DOM, and is just as breakage prone, all the while explicitly demanding you adhere to their code organization because that way they can encode configuration into class names and function invokations and all of them claiming the other is bad not because of intrinsic issues but because they don't make the same ideological architectural choices like one-page-apps or putting business logic (including navigation!) in pages - even though it's more predicated on popularity than functionality, and ALL of that built on top of the mess that is Javascript and you are well and truly sunk my friend. Not even a run-on-sentence has enough space to cover all the horrible stuff that lies out there for the aspiring web developer.

    So I recommend learning Javascript. Once you have a good strong feel for the fundamentals, once you've treated Crockford's "JavaScript: The Good Parts," the same way as you've done with K&R's "The C Programming Language," and you're solid on the basics, THEN jump off into these new worlds of overly pretentious web designers delving into their first languages and claiming you can't write a decent site without coffeescript, haml, and sass. So you can put them in their place, or at least, so you can understand how much they're complicating what is, after all, not that difficult of a thing. Even experienced developers write really, seriously completely awful code with Javascript, thinking they'd doing a decent job because they didn't invest time and energy to understand why they're not.

    The only problem is that Javascript is bad. I like learning by examples, but that is so not the way to go with Javascript. Examples abound - but they're more than likely to be bad examples. There's reference books, like "Javascript: The Definitive Guide," but they're not great for learning. So what I do is tell people to learn jQuery first.

    With jQuery and a few minutes, they can pick up the basics. Someone who already knows CSS or writes code for a living should feel productive in less than a full work day. It's easy, it's fast*, it handles browser differences**, there are well documented examples of how to use each feature on the jQuery doc pages, and best of all for me - it's non intrusive, so you can fit in the new vanilla javascript you're slowly picking up in, without needing to learn any framework specific configurations or magic function naming or guessing why it's not calling a method because it's not been added to the object prototype by your pesudo controller registration.

    For me, I hate frameworks that are all-or-one solutions. Big heavyweight*** frameworks that tell you "This webpage is now a ____ application". First, they never are perfect solutions, and second, they always make some percent easier at the cost of making the rest painful. I think when learning a new language, especially if you've already got one or more under your belt, forcing someone to do it your way, or making familiar patterns or constructs hard is a huge detriment. Besides, how can you expect someone to learn if they're not allowed to get it wrong? You end up with folks who don't understand the importance of things like memory management if they never had to do it, and how useful are they during crunch mode?

    So, yeah. Learn jQuery. Learn dom traversal and manipulation. Learn event registration. Learn AJAX. Try out some animations. Write a plugin or two. Many of these things are appearing in modern browsers now, but once you understand the concept, the basics that are endemic to web development, and you can be productive, then you'll have the grace time needed to properly learn actual Javascript. Then you get out your

  22. Re:Obligatory reply to a vanillaJS post by ArcadeMan · · Score: 1

    Who the hell still uses Javascript (library or not) to fade things in/out? Use CSS, damnit.

  23. Re:Obligatory reply to a vanillaJS post by JustAnotherOldGuy · · Score: 2

    Agreed. The site does do an unfair comparison, leaving out all of the benefits of something like jQuery. I've done plenty of projects where jquery sped things up and made it easy to manage. Doing them in native JavaScript would have been a nightmare and wasted a ton of time.

    --
    Just cruising through this digital world at 33 1/3 rpm...
  24. STOP by b1ng0 · · Score: 1

    Stop! Just stop already! Nobody gives a shit about Dice's clickbait fluff pieces void of content. We know you need to justify Dice's executive management's $1M salaries (http://finance.yahoo.com/q/pr?s=DHX+Profile) but this is getting ridiculous and you are alienating your most loyal users.

    1. Re:STOP by lucm · · Score: 1

      Dice's executive management's $1M salaries (http://finance.yahoo.com/q/pr?s=DHX+Profile)

      There's no woman in that list! Good ol' boys club still has control over at Dice. Where are the feminazis when we need them?

      --
      lucm, indeed.
  25. It depends by metamatic · · Score: 2

    If you are working on an existing project that has already chosen to use jQuery, then you should learn it.

    Otherwise, I wouldn't bother. Just learn Vanilla JS, and skip jQuery. Your pages will be faster and better.

    jQuery was a useful thing a few years ago, but now that browser standards compliance is so much better it's a big chunk of unnecessary code.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    1. Re:It depends by Khyber · · Score: 1

      "browser standards compliance is so much better"

      Not even. Closest one to any sort of compliance is Chrome, which is a multi-process steaming hunk of garbage. It can do HTML5 and WebGL properly.

      FireFox? Trying to log into my in-development game using the web interface, (again, pure HTML5 and WebGL) it fucking horks. What's sad is that IE8 works better for my web game than the latest version of FireFox.

      Opera? Give me a fucking break.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    2. Re:It depends by Anonymous Coward · · Score: 0

      You're both right though.

      Standards compliance *is* a lot better than what it used to be. It just isn't perfect yet. Not that I expect it ever will be, but still ...

  26. A Dissection of the Summary by Art3x · · Score: 1, Redundant

    jQuery isn't without its controversies

    Huh?

    and some developers distrust its use in larger projects because (some say) it ultimately leads to breakage-prone code that's harder to maintain.

    This article is less critical of jQuery than the summary led me to believe. It just warns you against two things: (1) a long procedure of code for the ready argument, "The Big Main Method Problem," and (2) DOM-centric code. But neither of these are problems, and neither of them are caused or even encouraged by jQuery.

    After the click-baitish FUD, the summary goes on, saying you might as well use it anyway:

    But given its prevalence, jQuery is probably essential to know

    The phrase "probably essential" is a weird combination of a weak and a strong word, and may be a sign of a writer who is half asleep.

    but what are the most important elements to learn in order to become adept-enough at it? Chaining commands, understanding when the document is finished loading (and how to write code that safely accesses elements only after said loading), and learning CSS selectors are all key. The harder part is picking up jQuery's quirks and tricks, of which there are many... but is it worth studying to the point where you know every possible eccentricity?

    Who cares? The jQuery reference is easy to browse for whatever you need right now, and there's little need to understand one part of jQuery to use another.

  27. JQuery is the JavaScript Standard library. by Qbertino · · Score: 2

    In my perception jQuery has basically become the JavaScript standard library.
    Basically any combination of frontend toolkits has it included somewhere, so you don't even have to worry about doing that. It's the default for Joomla and Wordpress and there are a measurable amount of functions that take care of the gruntwork and normalize utility across browsers.

    On top of that, the amount of JS projects relying on jQuery as a foundation is staggering. The secondary market has tools built around the jQuery ecosystem and the project as a whole does an excellent job at marketing and advocating.

    I personally see the next generation in such avantgarde stuff as Googles Polymer (pretty amazing) but until everyone has moved to SPAs and web components - which is not happening any time soon - but until then it's not the worst idea to familiarize yourself with the concepts and the utility funcitons of jQuery. ... *After* you've learned JS itself properly, that is.

    My 2 cents.

    --
    We suffer more in our imagination than in reality. - Seneca
    1. Re:JQuery is the JavaScript Standard library. by one+eyed+kangaroo · · Score: 1

      Absolutely. I cannot praise the jQuery ecosystem too highly. Coding with it allows you to approach the problem at hand with just the right mix of ease and complexity *and* it scales well.
      We have tried and abandoned many of the larger js frameworks.
      Just my 2c.

  28. Re: Obligatory reply to a vanillaJS post by Anonymous Coward · · Score: 0

    How about people who need to support browsers other than the latest and greatest? I'd love to tell everyone to upgrade. Unfortunately, with corporate intranets you are sometimes forced to support whatever your entire company is using.

  29. Re: Obligatory reply to a vanillaJS post by lucm · · Score: 1

    How about people who need to support browsers other than the latest and greatest?

    Does <blink> still work in your organization? What about <center>? You lucky dog.

    --
    lucm, indeed.
  30. Big Main Bullshit by Anonymous Coward · · Score: 0

    I was going to comment on the jQuery Big Main Method problem, and how it is only a problem if you let it be a problem. But because slashdot is being a little fucking bitch about curly-braces, instead I'm going to just say FUCK YOU AND YOUR HATRED OF CURLY-BRACES SLASHDOT!!!

    1. Re:Big Main Bullshit by Anonymous Coward · · Score: 0

      Whitespace is the way to go.

  31. Some Developers.... by Khyber · · Score: 1

    "some developers distrust its use in larger projects because (some say) it ultimately leads to breakage-prone code that's harder to maintain."

    Most likely because they write shit bloated code in the first place.

    Meanwhile, jQuery + SQLite + MariaDB connector, I've got my own personal intelligent porn recommendation/scraper/indexer site that runs through a few million images and renders my requested search results in under a tenth of a second.

    So odds are, it's those developers talking about breakage-prone code that are the crap devs, anyways.

    --
    Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
  32. Time to move on by Anonymous Coward · · Score: 0

    technology has moved on; jQuery is yesterday's solution;

  33. Faddish faggotry by Anonymous Coward · · Score: 0

    Or just stick to real programming languages, without jumping on the bandwagon.

  34. Re:Obligatory reply to a vanillaJS post by rev0lt · · Score: 1

    You are aware that vanilla-js is a joke site, right?

  35. No. by GrahamJ · · Score: 1

    18 year JS programmer here. Learn JavaScript proper (well) first, then a framework such as Angular.

  36. So? Not everyone is even a programmer! by bigsexyjoe · · Score: 1

    I think it's pretty clear that this means, given you need to write JavaScript for the browser, should you learn jQuery and if so how? The fact that accountants and plumbers don't really need to know jQuery is kind of a given, right?

    1. Re:So? Not everyone is even a programmer! by Shortguy881 · · Score: 1

      How will your plumber ever fix your IoT toilet, running node.js, that simulcasts your poops play by play on facebook and twiitter?

      --
      Brilliance without wisdom, power without conscience. Ours is a world of nuclear giants and ethical infants.
  37. Sure, why not? Learn to use selectors by bigsexyjoe · · Score: 1

    It helps some times, and if you are going to become a good JavaScripter, how much of the effort is really redundant? You'll probably need to learn how to select an element with CSS selectors even if you don't use jQuery. It's clear you eventually won't need jQuery for this, but a) jQuery is a little less verbose b) learning how to use selectors is 90% of learning jQuery.

    Granted, you don't need to learn how to write a jQuery plugin anymore, not that would be difficult to learn anyway. Aside from that, what is there? Using plugins: trivial. Using the jQuery's ajax stuff: trivial. Learning to use promises: you need that anyway, learning jQuery's slight differences isn't really a big deal.

  38. Re:Obligatory reply to a vanillaJS post by LordKronos · · Score: 1

    You are aware you could actually click on that link in my post, right? If you did, you'd have your answer.

  39. jQuery is crapware by Coolhand2120 · · Score: 1

    jQuery was relevant as a shim for browser compatibility 10 years ago - and even then only for AJAX. Modern browser's DOM API is far more powerful than what pathetic methods jQuery offers. And what jQuery does offer is often broken, deprecated or just shit code. Want to animate something the way the web animated things in the 90's? Use jQuery. Want to use native animation methods that are orders of magnitude more efficient, more featureful and MUCH easier to use? Use the fucking DOM API that comes with the god damn browser that jQuery is hiding from you. document.querySelector is a thing now! Need to do advanced event handling by manipulating the bubble/capture phase? jQuery can't do that. Are their binding selectors like fucking special or something? No, they just never did that and fuck you if you think you need to change the phase that your event fires at. And don't even get me started on the AJAX bullcrap - undocumented "features", suddenly deprecated properties without any documentation or reason why they changed, properties that make no sense: dataType for content-type? type for method? You do know that HTTP existed and had names for these things before you came along, right? Oh but you added "method" also, so "type" and "method" are the same but "content-type" is "dataType" - SERIOUSLY?! WHAT THE FUCK!? This is what all code would look like if the nazis had won the war. And the author! Riseg writes a book, called something like "advanced javascript techniques" and puts fucking syntax errors in it!! Not to mention it reads like "ah duh, I don't know what JS is, ah duh" Then the second book "secrets of the JS ninja" is actually a really good book, it has his name on it, but it also has someone else's name on it this time. So my guess is it went like this "John, you suck, but your shit is popular, can we have this other guy write a book and put your name on it and give you some money?"

    And that's just how jQuery has done me wrong. The real reason I hate it is how it continuously cripples programmers by teaching them idiotic programming patterns that should never have existed in the first place. You don't write a 2000 line application with CHAINING CONSTANTLY. Ever hear of a variable?! Do you think it might be better to use them instead of constantly abusing the queryselector? Do you think CPU cycles are free!? "OH HEY! IT CACHES THO!" Yeah, I'll bet it does it better than the native selector /s - oh wait! It probably executes 1 lines of code "if (document.querySelector) { return document.querySelector(e); }" Woooohhhhh JQUERY MAGIC!!!

    I think jQuery should be remembered as the lib that broke the internet. jQuery is the first lib that became so popular that the RFC process was aborted and now Risig makes up some idiotic shit on his own and we call it "standard" because of the logical fallacy "appeal to popularity". Just because a lot of people like it does not make it correct. Actually, given the average skill of web programmers I would say popularity should work against it.

    I'm going to spend the next several years of my life trying to undo the damage jQuery has done to the systems that I work with. And the damage is mostly human damage - that is, programmers that can no longer program web because of the things jQuery taught them. And god help the next candidate that comes in for an interview that writes "Languages Known: Java, JavaScript, C#, jQuery". JQUERY ISN'T A FUCKING LANGUAGE! Everything jQuery can do DOM API can do better, easier, with less code and everyone that can read JS can understand it. Learn DOM API - throw jQuery in the trash where it belongs.

    1. Re:jQuery is crapware by Anonymous Coward · · Score: 0

      If only vbscript had won out.

    2. Re:jQuery is crapware by Anonymous Coward · · Score: 0

      jQuery was relevant as a shim for browser compatibility 10 years ago

      jQuery wasn't even out ten years ago (close though, it was released in August 2005), so while it's relevance as an equaliser for the various browsers has diminished, it's certainly a lot less than ten years ago that it was important. It's only really about four years ago that most of us could really stop thinking about IE6 users, so I'd say that's probably a more realistic time frame for your remark than ten years.

      and even then only for AJAX.

      Ah, now that's simply wrong. Yes, we needed the shim for AJAX, but there is a *massive* amount of other bits of cross-browser weirdness that jQuery also patches. If you think it's just for AJAX then it's no wonder you don't have any need for jQuery. I'm going to go out on a limb and guess that you've never in your life had to write any significant amount of Javascript code that needs to work in both IE6 and modern browsers? No? I thought not.

      Modern browser's DOM API is far more powerful than what pathetic methods jQuery offers.

      Uh, so use it then. Just because you're using jQuery doesn't mean you can't use DOM methods as well. They're still there.

      And what jQuery does offer is often broken, deprecated or just shit code.

      Deprecated? Well, yeah. Don't use the deprecated methods. You're not meant to be using them. Yes, jQuery has them -- just like any other piece of software that changes over time. The implication of the word 'deprecated' is that they will be removed in a future version. So just ignore them, mkay.

      Bad code? Hmm, that's arguable. Have you taken the time to read the jQuery code? And frankly, a lot of the really fugly stuff that is in there is a necessary evil to work around browser compatibility issues.

      Want to animate something the way the web animated things in the 90's? Use jQuery.

      Again, jQuery was only released in 2005. And since you clearly weren't there in the 90's, let me tell you now that there was virtually zero animation on the web back then, except for animated gifs (ahg! my eyes! they still remember it!), and stuff built using Flash or Java. The web itself was pretty much static.

      Want to use native animation methods that are orders of magnitude more efficient, more featureful and MUCH easier to use? Use the fucking DOM API that comes with the god damn browser that jQuery is hiding from you.

      Actually, there are jQuery plugins that do animation through CSS. But you probably never looked for them.

      document.querySelector is a thing now!

      Yes it is. And it's great. To be sure, that isn't all that jQuery does, but the existence of dsQ is a massive relief to everyone who had to fight with the DOM in the old days.

      But if course, if you need to support IE8 (and a lot of us still do), dqS is a lot more limited because it only supports the basic selectors that IE8 supports. So you need to be careful of that.

      ....lots more ranting....

      I think jQuery should be remembered as the lib that broke the internet. jQuery is the first lib that became so popular that the RFC process was aborted

      Hahahahaha!!!!!!!! Oh man, that's a good laugh. Have you any idea how broken the RFC process was *before* jQuery? You obviously have no clue. When jQuery came along, we'd all just gone through five years of manic competition where the browser vendors implenented new features specifically do damage their competitors rather than improve the product. We then had another five years of stagnant development after IE6 was released where nothing happened because they'd killed the competition. jQuery came out just as things were starting to pick up again. But without the shims that jQuery provided, it would have been a heck of lot harder for Firefox to break through: jQuery made it possible to support IE6 and Firefox at the same time. That was a big part of the revolution that kicked off the modern web.

    3. Re:jQuery is crapware by Daniel+Hoffmann · · Score: 1

      One more thing:
      > Need to do advanced event handling by manipulating the bubble/capture phase? jQuery can't do that.
      http://bugs.jquery.com/ticket/...

    4. Re:jQuery is crapware by Dynedain · · Score: 1

      You bitch about devs lazily abusing repeated DOM lookups instead of variables, but that is exactly what prompted the Javascript speed war that even resulted in massive improvements on IE. So even if you think it's bad practice, it helped everyone.

      --
      I'm out of my mind right now, but feel free to leave a message.....
  40. Give it a whirl by Anonymous Coward · · Score: 0
    • It's easy to get started with (lots of docs and tutorials) and you can do cool stuff quickly without having to worry about browser inconsistencies.
    • Knowing that you can fiddle with css-ish selectors gives you an insight into how to structure and label your DOM
    • Of course you'll only use a fraction of it in real life depending on your application, so make sure you have a cheat-sheet to hand.
    • AJAXing? Of course you are. jQuery is a good introduction to how (and how not) to deal with the async nature of these calls.
    • One library for all applications? No of course not, but I would say jQuery is where you start from, as you'll then appreciate how smooth/ clunky/ gnarly/ adaptable/ hits-the-spot others are.
    • If you're collaborating then it's a fair bet others can cotton-on to making changes and vice-versa

    In conclusion it's a Swiss-army-penknife for the browser. You can play with it or carry it around at all times ready to whip out. Some here like to disparage jQuery, but the only case for specifically not using it is as a dependency for some library.

  41. Like Slashdot does... by Zilog · · Score: 1

    FYI, check this page source code. You'll find some jQuery code. It's funny how some articles here seem being related to Slashdot's tech...

  42. Thread dancing around issue by Anonymous Coward · · Score: 0

    This should-I-use-X-library BS is getting old. Some have touched on this tangentially with their replies, but if you learn JavaScript itself, then learning and using any random library written in it will be easy. So, learn JavaScript not the latest catchy library and then your indecision on which library to learn and use becomes moot.

  43. To get past HR it might be by tepples · · Score: 1

    A more serious answer:

    If you are seeking employment by a company as a kernel developer, and you want to publish your portfolio on a website in order to get HR to consider you, you might need some scripts on that site.

  44. To insert the class by tepples · · Score: 1

    Who the hell still uses Javascript (library or not) to fade things in/out? Use CSS, damnit.

    You still need the script to insert the class that triggers the CSS fade or size transition. You also need the script to work around the fact that CSS cannot transition to or from height: auto .

  45. Insecure browsers by tepples · · Score: 1

    How about "compatible with browsers that still receive security updates when needed"? Windows XP is the last desktop Windows operating system that can't upgrade past IE 8, and it's been unsupported for over a year. Windows Vista has IE 9, and Windows 7 has IE 11.

  46. jQuery is great in libraries vs frameworks by kisrael · · Score: 1

    Personally, I find jQuery great as the baseline to support bespoke programming solutions.

    There is a LOT of love for framework over libraries like jQuery, but in my experience most hit up against Dietzler's Law* pretty hard. with frameworks one has to be rock solid in the real browsers stuff AND the framework one chose AND the hacks you had to set up to meet the gap between requirements and the framework sweetspot. (vs bespoke, where it's just the real browser stuff and then straight to the gap ;-)

    *Dietzler's Law: "Every Access project will eventually fail because, while 80% of what the user wants is fast and easy to create, and the next 10% is possible with difficulty, ultimately the last 10% is impossible because you can’t get far enough underneath the built-in abstractions, and users always want 100% of what they want" - but it's generally applicable

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
  47. Why is this a question? by Anonymous Coward · · Score: 0

    Why are you even asking? jQuery has such little overhead that if you want to be "adept" at it for maintenance or basic tasks, all you need to do is use it a few times.

    This isn't some complicated language and you're not going to be building anything incredibly involved with it (you should use JS for that stuff, anyways). Hell, it's not even a language in it's own right. You're only going to be using so much of it anyways. See if there are any free interactive tutorials to help you take the training wheels off and then just use it. Become familiar with it and learn how to navigate the documentation. Done.

  48. Yeah. by bobmajdakjr · · Score: 1

    It is only breakage prone if you are bad and use $. Just save yourself a shitload of headaches and type jQuery() instead of $(). Then later when you feel even more hipster you can start duct taping more random.js junk to your project and none of your jQuery code will [most likely] not conflict with them. I won't even touch Javascript without jQuery. It's nice being able to do things like [for].each() with no effort like languages should have natively.

  49. Re:Obligatory reply to a vanillaJS post by rev0lt · · Score: 1

    I actually did. Maybe we have a different sense of humour.