www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: Why the Overuse of Javascript Libraries?

  1. #16
    Join Date
    Aug 2006
    Posts
    1,909
    Quote Originally Posted by Jarrod1937 View Post
    Now this i just find hard to understand. If you lack the understanding of the core functionality the library bases itself on, then you're just limiting yourself to what you can do. To me it would seem that understanding whats going on in the entire system would lead to to additional functionality (and security) down the road. Not to mention that you can attain this functionality with the pluses of better performance, code size...etc.
    If you'll forgive another personal trip down memory lane... I met my future wife as a programmer, when they put us on a project together. Typical programmer/analyst type jobs, both of us. Go see the customer, write up and agree on a requirements/scope document, crank out the code, sign it off. As we started doing this stuff, it became clear that she was far better than I at the "go see the customer" half of the job, and I was far better at the "crank out the code" part of the job. That happens, people aren't all the same. But my point is that neither of us really were desperate to "be the best we could" at the part the other was good at. So while this discussion might be focused on why she didn't want to spend lots of time/brainpower on becoming a hot shot programmer, and yes she would easily fit into your "overuse of libraries" category, she could just as easily be typing on a forum called WorkWithPeople.com right now, where they're talking about why someone would care to understand exactly how the computer works, when there are tools like content management systems, libraries full of nifty routines, and god forbid, clip art available, all for free.

    Please forgive me if i had too vaguely stated my initial position, my main curiosity is not just about performance (though that was a biggy), it was mainly about why so many rely on a library for something that is already close to the core functionality of the language itself (hence the comment "but not when you're only using 1% of the libraries feature set"). Its almost like using a "calculator" library in c++ to do arithmetic manipulations, sure its interface may seem cleaner compared to the core c++ code, but the functionality provided is already so close to the base language that you might as well use that. Sorry if i seem argumentative or preachy, just trying to get a grasp on other's thinking toward these topics.
    I'm not sure whether my example relates to your last section here, but this sounds a bit like "once you have a hammer, everything looks like a nail". Once you install JQuery, perhaps the answer to many questions is "JQuery can do that"?

    Dave

  2. #17
    Join Date
    Mar 2010
    Posts
    672
    Quote Originally Posted by tracknut View Post
    If you'll forgive another personal trip down memory lane... I met my future wife as a programmer, when they put us on a project together. Typical programmer/analyst type jobs, both of us. Go see the customer, write up and agree on a requirements/scope document, crank out the code, sign it off. As we started doing this stuff, it became clear that she was far better than I at the "go see the customer" half of the job, and I was far better at the "crank out the code" part of the job. That happens, people aren't all the same. But my point is that neither of us really were desperate to "be the best we could" at the part the other was good at. So while this discussion might be focused on why she didn't want to spend lots of time/brainpower on becoming a hot shot programmer, and yes she would easily fit into your "overuse of libraries" category, she could just as easily be typing on a forum called WorkWithPeople.com right now, where they're talking about why someone would care to understand exactly how the computer works, when there are tools like content management systems, libraries full of nifty routines, and god forbid, clip art available, all for free.
    Haha, point taken, i may just be being a bit narrow minded with my view on the subject. Different personalities, strengths and interests all lead to varying perspectives on such issues, including ones that are quite the opposite in nature.

  3. #18
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    Quote Originally Posted by Jarrod1937 View Post
    my main curiosity is not just about performance (though that was a biggy), it was mainly about why so many rely on a library for something that is already close to the core functionality of the language itself (hence the comment "but not when you're only using 1% of the libraries feature set").
    I don't encounter this scenario often in my job, so I can only speculate... but I'd think people are fine using jQuery for small tasks because, frankly, jQuery has a small footprint. Despite all the ranting about performance, jQuery's impact is actually very small when measured with net tools, and even smaller when measured by users' perception.

    So why use jQuery when you only use 1% of the library? Why not? -- is the answer. Because the downsides are almost nonexistent.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  4. #19
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    Quote Originally Posted by NogDog View Post
    Maybe we need some sort of a JS library application that will generate the necessary javascript file based on what will actually be used, so that you then end up with a JS file with only the functions/classes you'll actually use. (I.e., sort of like if you program in a compiled language and use some 3rd-party library; then when you compile your executable it only compiles in the parts of that library your code actually uses.)
    Interestingly, most libraries now have loaders, so you can dynamically load only the functionality you need.

    For instance...

    YUI
    Code:
    YUI().use('dd', 'anim', function(Y) {
        // Y.DD is available
        // Y.Anim is available
    });
    Closure
    Code:
    goog.require('goog.dom');
    goog.require('goog.editor.Plugin');
    Strangely, jQuery is one of the few libraries that still doesn't have a loader.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  5. #20
    Join Date
    Mar 2010
    Location
    Singapore
    Posts
    367
    Strangely, jQuery is one of the few libraries that still doesn't have a loader.
    I was suspecting could it be other competing JavaScript libraries split their functionalities into different JavaScript files. Then depend on which you want, they only serve that JavaScript file to you and not the rest of them?

    In contrast JQuery code is all into a single file. This mean it have some problem duplicating the "dynamic loader" concept.

    I think this is more of design issues rather than JQuery being bloated (in fact I think 26K+ is ok for me actually).

    I also agree if one only use 1% of JQuery, then just write your own version for that small functionalities. But if you are going to use say 30-40% it is more than justifiable to go for a full-blown JavaScript libraries.

    Please note this library concept isn't anything new. In Java, C, C++ etc etc using pre-built libraries already exist and JavaScript ain't no exception either. It could be JavaScript has progressed so far that it is behaving more like those full-blown programming languages.

    This is good progress for JavaScript! It want a place to be side by side with those traditional programming languages cousins. JavaScript has grown up :P

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles