views:

1763

answers:

24

I'm struggling with the value of knowledge between JavaScript base functionality and JavaScript libraries.

While I understand the underlying concepts used by many of today's popular libraries (JQuery as an example: $.ajax, $.animate, etc), I find that the more I rely upon these libraries, the less and less I actually know about JavaScript on its own.

I'm wondering how much other people handle this disparity...do you intentionally ignore libraries at times in order to maintain skills in straight JavaScript? Rest happily knowing that the function calls you made with your library of choice will work on a wide variety of browsers without the headache? etc.

I find that under time constraints, in many cases there isn't even time to use anything but a simplified library because the testing and sheer size of code would eclipse the time allotted to JavaScript functionality.

Anyway...what do people think?

Edit: Since it seems to be a bit unclear (I bet the title is at fault here), I'm not trying to argue for or against either point of view, just stating the fact that I do lose a bit of one when I gain a bit of the other. By no means do I find the use of a library bad, I just wanted to see how people cope with the shift of knowledge or if it's even necessary to cope. Thanks for all the input so far.

+51  A: 

I rest happily, knowing that the function calls I make with my library of choice will work on a wide variety of browsers without the headache.

After ten years of dealing with IE's bullcrap, I'm done with caring about the intricacies of javascript. The jQuery experience is what javascript should have been like.

Looking at it another way, you're gaining skills in new technologies that these libraries represent. It's not a negative-only proposition.

womp
jquery is what javascript should have been? That's a silly statement, jquery is a library and js is a language. How about, browsers implementation of the DOM should have been more coherent, that's why need libraries. They also provide simpler APIs for all the things DOM creators didn't foresee and widgets not supported by HTML.
Juan Mendes
Obviously it's a library. I was talking about developer experience. If javascript had been like jQuery ten years in terms of all the cross-browser and (relatively) complicated DOM manipulation, people wouldn't have to be rediscovering it today.
womp
I think the reason people are "rediscovering" it today isn't because it was too hard, but because it was originally marketed and largely percieved as a "toy" language, or a "glue" language for Java applications to interact with the webpage they're embedded in. Not because it was too hard, but because it was too easy, and had the word "script" in its name, and thus wasn't worth any serious amount of attention or investment of time. History is what it is, and there's no changing it. "If only the internet worked 10 years ago like it works now, it would have been just as popular then!". No.
Breton
I just wanted to get in that 10 years ago, computers weren't nearly as fast as they are now, and that's also one of the factors in javascript's "rebirth".
Breton
+6  A: 

I find that the ability to competently manipulate the libraries is fast becoming just as valuable (if not more so) as the knowledge of the underlying language when it comes to JS libraries.

That said, I use what is best for the task at hand without worrying about degradation of my skillset in either area.

I've met a quite a few programmers with a "use it or lose it" mentality about their skills, and i just don't see that as being the case for specific skills (for programming in general, it definitely is). The skill you really need to constantly develop is the ability to know what the best tool for any particular job is. From there, everything else is really just a Google-search away.

Gus
+1  A: 

If you are using a library and not trying to understand how it works, is wrong anyway. Be it javacript or C# or Java, the aim is standard, testability, reducing time to build and not re-inventing the wheel.

Perpetualcoder
+7  A: 

A few years ago nobody could imagine a programmer not working directly with pointers and memory allocation. Nowadays, Java and C# folks couldn't care less about these things.

The same happens with raw JavaScript vs. libraries. It is of course preferable that you know the foundation but the priorities have changes. Rapid product development and short time to market are more important.

Developer Art
+7  A: 

Please use a library.

The APIs the browsers offer to scripts are not just inconsistently implemented and buggy. They're also just plain ugly APIs, when you actually stop and look at them.

I'm not sure why you'd be worried about libraries rotting your brain, either. It seems to me jQuery actually demands more JavaScript-fu from the user than the bare browser APIs. At least I never saw people trying to use closures like that in the wild before jQuery came along.

Jason Orendorff
Closures were pretty common way before jQuery. I don't think the two things are closely linked.
Tim Down
+15  A: 

I wouldn't consider the ability to type "getElementById" over and over a skill capable of degradation. If you know how the libraries work, you're not going to forget anything that cannot be recovered with a 30 second refresher course. If you don't know how the libraries work, then you didn't have any skills to begin with.

Azeem.Butt
I don't get the whole $_ bit... but then again, I was never very good at Javascript.
Chris Kaminski
+3  A: 

If you think you found a higher level of abstraction that you can actually trust, you may well be right to try to abandon completely the lower level that will just hinder your productivity.

New projects are not done in assembly anymore, and knowledge of assembly is fading away slowly. Is this really a bad thing? Maybe not, programmers that care about assembly still have the ability to learn and use it but the majority of us just don't care.

Vincent Robert
+2  A: 

Try to build your own framework and libraries.

Steal ideas blatantly from your favorite libraries, but implement them with your own pure javascript.

When you are working on something that absolutely has to work 100% on all browsers, and it has to work that way yesterday, feel free to use a library... unless you are confident enough in your own framework to use that instead.

That should be your goal. If you don't get there, jQuery will be there for you to fall back on, until someone builds a better framework.

MikeEL
+1 the sky is the limit, not libraries. You can and you will often find better ways to solve your issues by getting inspired by what exists and improving it to better suit you own needs.
Eric Bréchemier
+3  A: 

We should look a libraries as advancement of technologies/skills. They save developers time hence increase productivities. Saying javascript libraries degrade skills is just like saying C# degrades skills as people no longer have to code in assembly.

ICodeWith.Net
+3  A: 

As an application developer, I rest happily. Re-writing code that has already been written and tested doesn't add any value to my application. I focus on features and quality instead.

As a software engineer, I find other ways to continue my development. There are lots of them! Without having to spend every minute on browser compatibility, I can focus my attention on the overall design of the application, or on making cool new features that just weren't possible before the browser innovations of the last few years. I can contribute back to the libraries I use (most of which are open-source) when I want to brush up on my JavaScript skills. And I can read blogs--reading the blogs of engineers who work on browsers and JavaScript libraries is a great way to deepen my understanding of what's going on under the hood.

Annie
+15  A: 

If we don't keep upgrading our effectiveness via good use of tools, then we need to worry about our future cephalopod overlords.

Octopus using tool

Underwater footage reveals that the creatures scoop up halved coconut shells before scampering away with them so they can later use them as shelters.

But seriously, it should not be assumed that just choosing lower levels of abstraction in a workflow necessarily degrades a programmer in any holistic sense (one's goals and constraints should be evaluated to help make the best choice of technique and tools in any scenario).

micahwittman
+1 for the picture :)
jbochi
Saw this video on CNN the other day. Startled the hell out of me, because, well, these creatures didn't know about coconut half-shells until we started throwing them into the water.
Robert Harvey
jbochi, thanks! Robert, huh - that makes it even more of a head-scratcher.
micahwittman
+1 for the overlord warning. Be afraid, be ... slightly afraid.
David Robbins
Every time I watch that video I have to remind myself it isn't leaked footage of a live action Starcraft movie.
Sneakyness
A: 

When talking about javascript and jQuery, I usually still resort to plain javascript skills to manipulate any non-trivial ajax-fetched data before displaying it.

And I believe in quite the opposite of what you said: using an open-source library like jQuery is the easiest path to cross-platform solutions.

Groo
I wasn't trying to say that it was harder, I was saying that I feel that I slowly lose touch with the things JQuery works around. Perhaps that's a good thing. I just wanted opinions :)
Tegeril
+1  A: 

The problem isn't really with JavaScript itself, but rather with the DOM implementation of the various browsers.

That's what libraries like jQuery are meant to fix. That and IE6 still requiring an ActiveX control to do AJAX calls.

R. Bemrose
+1  A: 

Use an accepted library at work and write your own in your spare time. Start with the question: what that library is missing and how can i make it better.

stereofrog
+7  A: 

I come from a strong ActionScript background, and started with ActionScript 2, which is a typed, a little more magic (mostly unknown to AS2 coders), yet clean version of JavaScript that runs on one platform only, and thus quite consistently (I'm not taking gnash into account here, I know :)).

JavaScript is a beautiful language, but to most people, it is just a very permissive way to add interactivity to otherwise crappy web "applications" ... why not write proper JavaScript? why not use serverside JavaScript instead of PHP? why not use JavaScript for maintance scripts instead of bash or Perl or whatever?

My advice: I think, you should try to dive deeply into the language and try the many concepts it actually offers ... however, I see no value in knowing about all the different browser quirks ... there are several libraries taking care of that for you ... however, JavaScript can do much more than just a little dom manipulation ... here's a nice short article on JavaScript I'd suggest to read ...

I know, this is quite off-topic, but I wanted to also point out haXe to you, which might be very interesting for you, as it is also a very nice language and a little similar to JavaScript, yet much stricter, and can be translated to JavaScript, but also PHP, C++ or ActionScript 3, and compiled to Flash Player 6-10 and NekoVM bytecode ... there's also a jQuery wrapper on haxelib ...

greetz

back2dos

back2dos
+2  A: 

Here's my take on JS libs. You should understand what is going on under the hood. They are the abstractions that you should/would have created on your own as you encountered difficulties when programming with JS/DOM. However, libraries are tested by thousands of people in ways that your code will never be. Morevoer, there will always be times when something doesn't work with the library and you need to find out what is wrong. I do that with ext-js all the time.

My main point is: You still need to learn javascript. JS libraries mostly abstract the DOM. Do I really want to go through the trouble of implementing a query engine like jquery's? No. Do I need to understand what actual DOM calls are being made? Yes.

Juan Mendes
"libraries are tested by thousands of people in ways that your code will never be" - yes, but your own site will be tested by you a thousand times where no library developer will: that's one more reason to know how things work, to create the tools you need, not just using the tools you have at hand.
Eric Bréchemier
+2  A: 

Libraries and tools are wonderful for getting around the grunt work of say developing cool functions, interfaces and a plethora of features for websites of all shapes and sizes. But the reality of the matter is libraries will not teach you Javascript in its most useful manner, which happens to be in its native form, its core. Yes, utilize Javascript libraries and get acustomed to their formats, weaknesses and strengths, but don't set aside your need to learn Javascript without the use of libraries. For, one can't call themselves a true developer or engineer of a scripting language if one can't venture from the contraints of their choice libraries or tools to get the job done.

Here's a comparison: You wouldn't call yourself an airplane engineer or mechanic if all you know how to do is check the oil, add gas, utilize its fly-by-wire instruments and fly the plane safely to your destination. Same thing with JavaScript, if you take in the core, you'll surely have the tools needed to understand what libraries have in store.

drlouie - louierd
A: 

I was a strong assembly language programmer years ago. I worried macros might ruin my skills and I couldn't imagine any other programming language being fast enough to meet my needs and the needs of my user. Ahhh, those were days.

Upper Stage
+9  A: 

I'm a member of the jQuery project team and can tell you that you should work towards having a better understanding of JavaScript. This will allow you to leverage jQuery (or any other framework) to its fullest.

While jQuery may abstract much of the complexities of cross-browser development, at the end of the day, you still need to know the syntax and coding constructs of the JavaScript language to build compelling applications.

Rey Bango
+4  A: 

I wouldn't say it's worth worrying about.

An analogy to this situation:

Say you knew how to do something the hard way. Something like sharpening a pencil with a knife. It's fairly obvious, but it's slow, tedious, and messy. It's only dangerous if you're stupid. ...away from the body...

Say you learned a better way. Something like using a manual hand pencil sharpener. It is extremely obvious how to use it, much more so than the first method of sharpening. It's faster in almost every case, it's easier to use, makes less of a mess. You also have to be exactly two orders of magnitude more stupid to hurt yourself doing it this day.

Say you discovered an even better way. Something like an electric pencil sharpener. It's perfect. There is only one way to do it wrong, and that is by sticking the eraser-end in first, in which case you likely did it on purpose 'just to see what would happen'. It's always faster, produces better results with more consistency, requires less overall effort on the user's part, and cleans up after itself. Maybe stupid people won't be able to use this one, because they'll forget to plug it in.

If you had started off with just a pencil and a knife, you probably really appreciate that electric pencil sharpener. You probably feel awesome every time you use it, just thinking about all the work you just avoided. You also know what to do in the event that the electric sharpener breaks or is unavailable.

If you had started off with the manual hand pencil sharpener, you still really appreciate the electric sharpener. You might take the awesomeness of it for granted having never been forced to sharpen a pencil with just a knife. You're aware of the processes going on inside of the electric sharpener. If everything fails, you could likely do an alright job with a knife, or build your own manual sharpener. It's a simple machine after all.

If you had started off with the electric sharpener, you probably hate them. They're noisy and smell like sawdust. Sometimes it cracks the lead (all pencils are obviously flawless in your mind, so you blame the sharpener), sometimes it doesn't sharpen it right. They can't sharpen crayons, or anything else really. They're heavy and impractical to carry around with you. In the event that it breaks, you'll probably go buy another one or use somebody else's. You might not even be aware of the existence of manual hand pencil sharpeners, or that a knife is all you really need to sharpen the pencil.

I would equate these levels to something like:

JavaScript > jQuery > jQuery Validation plugin

It's like a one way slope. Starting at JavaScript and working your way up is relatively easy, whereas starting with jQuery Validation and then learning jQuery, and then learning JavaScript will seem really silly to you and you probably won't ever bother with it.

Sneakyness
I agree with this analogy, however I worry about the knowledge of how to make a pencil sharpener. The person who can sharpen the pencil with a knife by hand understands the ways that are better for not breaking/cracking the pencil, and could apply that knowledge to the creation of a newer sharpener. If people only know how to use the sharpener, we run out of people who can make better sharpeners. I'm quite torn on the matter to be honest.
Tegeril
The manual hand sharpener bridges the gap. You can look at it and easily tell it's purpose, and having used one you would likely be able to build one. It's a cone + hole + blade. Trial and error would result in a decent sharpener.
Sneakyness
I stuck my finger in the electric pencil sharpener.
Callum Rogers
+2  A: 

We're starting with jQuery to deal with major corporate upgrade and avoid browser issues.

We'd like to concentrate on content and features, not pixel shifting and fighting browser quirks

Off topic:

If this question was "Degradation of SQL/DB skills as a result of ORMs", would people feel the same way...?

gbn
+2  A: 

Libraries are tools. You need to know how to use them before you can use them effectively. That means knowing the language.

I rarely use libraries. I've been doing this long enough to know what works in the different browser versions, and I've written my own code to make DOM scripting and Ajax calls less cumbersome.

Jeremy
+2  A: 

I think what you need to take into consideration is what domain you're programming in. If you're doing web based frontend programming and jQuery is what you're using, then there's really no problem with not doing more "javascript" programming and instead becoming an expert in jQuery.

Javascript is often misunderstood because of the classless-ness, lack of modules, the association with crummy browser behavior and lack of use outside of the browser. I personally think that javascript in reality a very nice language. I suggest that you should try other libraries out (YUI, Dojo) which are closer to "Javascript" programming and read the code if you are afraid of losing your skills in javascript.

I'd like to bring to light that the uses of javascript outside of the browser are increasing with very cool projects like rhino (server-side js), commonJS (gives js modules), node.js(async io js) etc. Maybe you would "regain" your javascript skills if you explore those projects.

Andrew Kou
+1  A: 

If anything heavy use of libraries like jQuery and MooTools have helped my general JavaScript skills.

Before using these libraries I'd avoid JavaScript as much as possible and when using it only stick to very basic functionality.

jQuery and company have opened up a whole new world of JavaScript. By looking at their code (and well designed plugin code) I feel like I have a much better idea of what good JavaScript looks like.

Luke Lowrey