Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm a self learner in javascript and I'm currently following the lessons in the book named "Beginning javascript 3rd edition" by Paul Wilton.
So far I've advanced myself towards chapter 4: Javascript - An object based language, and I did follow and solve the exercises provided inside the book. I tried to write a calculator myself, and by modifying and changing the code, every time I learn something new to enhance it.
How can I become good in javascript coding? Is there any special approach? Is there any concept or things I should learn first? What kind of study/career path should I follow for javascript? Anything I should be aware of?
I really have the courage to continue learning javascript, I just need some guidance.
I don't mind any expert opinion given, or pointing out any mistakes regarding this question, as I know that through my mistakes, I always learn something.
Consider JavaScript as a true
programming language
Learn the
difference between Object-Oriented
and Prototype-Oriented languages
Make sure you understand how
JavaScript (language) is related to
DOM (API) and never mix things up
Don't jump into "using jQuery to
solve all JavaScript problems" as
jQuery does not solve any problems
of JavaScript but rather those of
DOM
A very good way to learn (not restricted to JavaScript) is to have projects where you need to do something with the language (in your case JavaScript) you haven't done or haven't tried.
I have noticed that I improve a lot when I have a project and have to do something I am not really familiar with or I am not that great at. Last project required the use of web services with php, something I had rarely used, but this made be learn and study and just try to get better, which I did.
So my advice is try to have a project where you have to do something with JavaScript that you have no idea how to to.
JavaScript is unlike most other languages. While it is Object Oriented, it is weakly typed. This provides much greater flexibility, but at the same time, limits itself.
Keep a few sites in your pocket:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide
http://javascript.crockford.com/
http://www.addedbytes.com/cheat-sheets/javascript-cheat-sheet/
One last thing:
Be aware of Douglas Crockford. Read his books. Read anything you can find with his name on it.
Conquer Level 1 First...The Princess can wait!
I would just do what is necessary first. Don't bother with the advanced stuff unless it's absolutely necessary. Most of the things you'll use JavaScript for are very top-level and superficial. Get the syntax, loops, types, etc all down first. Don't confuse yourself with the more difficult aspects of it until you've conquered level 1.
Then Move on to Common Solutions to Common Problems
I would even suggest learning something like jQuery before trying to learn how to extend prototypes, etc. Make yourself useful immediately by learning the stuff you'll be using frequently, and tackle the difficult stuff at a later date when you've got the time.
The same way you become a better programmer/writer:
Read a lot, write a little. Repeat ad nauseam.
Also, read this other related answer.
If you are starting on Javascript, I would recommend you going to this website.
However, if you already know bit of javascript, then it all depends on practice. This is the only way i know of that can make you a good programmer. And this apply to just about anything and any programming language.
Try to come up with your ideas and materialize them using Javascript.
How about building your own lightbox?
How about creating your own table filtering/sorting?
And how about all the cool stuff you might have in your mind?
Thanks :)
Program a lot
Read JavaScript: The Good Parts
Use JsLint!
Go to 1
I would suggest you try to go through following:
1. Book -Javascripts: the good Parts by douglas Crockford. Make sure you understand the points he raises in the book and try to implement them accordingly.
2. Do not just try to javascript functions for website validations; as static functions in javascript is the worst thing a developer can do.
3. Try to implements OOPs concepts in Javascript and see how using functions you can model your objects and their behavior.
4. I would highly recomment small design patterns problems to be solved in javascript, as that would bring out the understanding of functions and invocation patterns in javascript.
Hope it helps.
Focus is objects oriented nature of javascript and not just the syntax
It also helps also to install firebug and try out different things in the console.
Start with Javascript : Definitive
Guide . Pay special attention to the 1st
part core language features
Check crocford blog/site with the reading of this book
Now the time is for Javascript:Good parts
For More in depth knowledge check the ECMAScript3 and 5 refrence
Finally, try to learn some other prototype based language as well like self
For DOM API's check other parts of Javascript : Definitive
Guide and sites of respective browsers
I'm surpised with the comments here about learning Javascript. Let's not forget - you don't want to learn it all! While the language is quite great if used correctly, it has a tainted history and many horrid parts. Luckily, you really only have to listen to a single voice:
Douglas Crockford also wrote The Good Parts, which is a nice little Javascript book. He does a bunch of stuff at Yahoo! and has materials on their YUI Theater that explain the problem quite well:
http://developer.yahoo.com/yui/theater/
This is a really great read:
https://developer.mozilla.org/en/a_re-introduction_to_javascript
For beginners w3schools or tizag.com would be more better choice ..
Answer by Sergey is completely agreeable to me .. It is a good approach ..
All the best friend .. :-)
I think that Object-Oriented JavaScript by Stoyan Stefanov is an amazing book, but that could just be me.
I'd suggest you the definitive guide to the language of your choice!
Please ignore any kind of javascript style kind of programming that may be fashion today.
Just learn the language! Fashions may change, and if you know the language, then you know something that resists, rather then samething that is fashion for some predeterminate time....
For example, read this book! Take the time, and you will reach the next level ;-)
Like with everything else: learn and practice.
How to learn the others already wrote.
I would suggest finding a javascript framework and learning how to use it. Then you can see practical applications to how javascript works in real life. It will give you practical applications, and a much more specific (and larger) set of answers to "how to I..." type problems.
jQuery is a good framework to begin with, YUI and/or Prototype are good if you really want to dig in -- those two are meant for building your own resources, whereas jQuery is more focused on being easily usable.
Modern javascript is heavily about "prototyping" javascript to build in new functionality that's not included in its implemented specification. In other words, it moves beyond the basics of how to code in javascript found in most books and into the realm of "how to make javascript do more than it was intended to do." But the basics are a must if you intend on prototyping the language.
If you want to learn javascript purely for servicing clients and making better websites, then it really depends on how you learn. Personally, I learn more through practical application than just reading and exercises. If you're the same, then I suggest reading through (not working through) your book and meanwhile do a lot of reading up. I suggest "yui vs. prototype vs. jquery" as a starting Google search.
Think up a simple project you'd like to do, and then try and implement as many cool javascript features into that project as you can (ajax form submissions, automatically updating graphics based on form selections, image zoom, and animated fade effects some to mind as the most practically useful).
Again, it really depends on what your goals are -- do you want to become a contributor to a framework like jQuery, write plugins, or just know enough to implement functional javascript on a client website and look good on a resume. If it's the latter -- pick a framework, learn it. jQuery is the most user-friendly, Prototype is the most functional, YUI is as functional as Prototype, well supported, and a great up-and-comer.
You may want to look into major Javascript frameworks such as JQuery and MooTools. Understand the differences between them and pick your favorite.
Here are some links :
http://jqueryvsmootools.com/
http://blog.creonfx.com/javascript/mootools-vs-jquery-vs-prototype-vs-yui-vs-dojo-comparison-revised
Related
I'm pretty efficient in jQuery, having implementing it in several projects for my company. However, I found myself a little lost when reading stuff like node.js.
Do I have to go back to basics and learn the JavaScript language or should I just stick with jQuery?
One more thing I would like to ask: Does coding in plain JavaScript increase performance compared to coding with jQuery? For my own experience, coding heavy, complex combination of animation in jQuery always seems to take up large amount of the computer memory.
You should understand what's going on, to a degree. It doesn't hurt to know what's underneath, but sometimes that's not optimal to know everything either, for example: is .innerHTML consistent? Not completely, e.g. <select> in IE. Does that mean you need to know every inconsistency? Not if you're letting jQuery handle it.
People say you need to understand JavaScript before jQuery, let me say I agree, however there are limits to that though, you don't necessarily need to know every quirk and inconsistency between browsers for example, that's why we use an abstraction layer.
To me, this is no different than saying you need to learn assembly before C#, should you know what's happening, how memory is referenced, what a pointer is? I think so, do you need to know every detail? Probably not. We would never progress if every new programmer goes through learning every layer beneath, this is why math theorems build upon others known to be true, same concept.
You should be able to trust your abstraction layer. Is this always true? unfortunately not, but jQuery does a pretty good job at being as consistent as possible and always improving. More importantly, the community does a good job of making the inconsistencies known.
Edit: Let me caveat everything above by saying if you can learn what's underneath do so (this applies to most any abstraction in my book, not just JavaScript), it will help you program better and more efficiently. If you know what's going on under the covers, you can more optimally take advantage of it.
It's a lot like apples and oranges, actually. jQuery is awesome library but it focuses on DOM manipulations. It does not help you much with general coding, prototype inheritance, closures, data types and other important stuff you have to deal with when programming.
node.js have nothing to do with DOM, so it is very much orthogonal to jQuery, no wonder you have trouble understanding it.
Note, however, that knowledge of JavaScript won't necessarily mean you'll be efficient with every JavaScript library out there. Each library makes kind of a superset of a language, a domain specific language to help with specific task that library was built to solve. You will always have to learn that DSL first to be efficient but it'll be easier to understand internals of any given library if you know JavaScript well.
If you are only interested in application programming (web sites and applications) then jQuery is more than adequate. If you want to develop a JavaScript framework or library, then proficient knowledge of the JavaScript language is necessary.
Does being good in jQuery imply being good in JavaScript?
No. I strongly suggest you learn the basics and then some.
jQuery is just a library. While productive, being well versed in the functionality that a library provides is not the same as being good at the language in which that library is written in.
I'm not saying that you need to know that all bitwise operations are converted to signed 32-bit integers in big-endian order, but you do need to know about core concepts like closures, how to properly attach event handlers, and the basic concepts of asynchronous/event oriented programming.
What if you were to change jobs to a company that uses ExtJs instead of jQuery? Understanding the core concepts of the language will make these sorts of transitions non-problematic.
Another thing to consider is that for every library, there is always a task that it doesn't support. Being reliant on a library to always do the heavy lifting will eventually bite you in the hind parts.
Does coding in plain JavaScript increase performance compared to coding with jQuery?
Libraries typically aim to be as generic as possible for the area of use they are targeting. Because of this, inefficiencies may occur in some scenarios that could be otherwise optimized outside of the library.
It all depends on how adept you are at JavaScript, algorithm selection/creation/analysis, and programming in general. When you start concerning yourself with being as high performing as possible, you really need to be able to get down to the finer details of a language. "Being good" at jQuery, or any library for that matter, will likely not help you with this (unless you're looking under the hood and implementing their techniques in a manner that is specific to your scenario).
jQuery is just a list of (very) useful functions, written in JavaScript.
You are just using the library without understanding what's behind it
and how things work. Most of the time you will only need jQuery for maybe 20%-40%
of your code, and the rest will be pure JavaScript, so I encourage you to learn the
basics. These are good places to start with:
http://www.w3schools.com/jsref
http://howtonode.org/what-is-this
http://net.tutsplus.com/tutorials/javascript-ajax/the-basics-of-object-oriented-javascript/
http://ejohn.org/apps/learn/
I'm a bit ambiguous on this. Knowing real deep JavaScript is a great art - I am always in awed silence when one of our resident deep JavaScript experts comes to the table. However, not everyone needs that kind of deep knowledge - if you're focused on building interfaces, knowing one of the frameworks well may be everything you ever need, with very few edge cases.
On the other hand, knowing at least the basics of how JavaScript works under the hood can only be beneficial. If you feel driven to take a look into it, I'd say do it. You don't have to become a total guru in fundamental JavaScript but having a basic idea of how data is handled internally, how events are processed by the browser, how memory is managed, etc. is a good thing.
Not necessarily, it is like saying like being good in Java is same being good in byte code since it is using the byte code.
jQuery is an abstraction layer for JavaScript, and for this reason most of the time you will be doing it all in jQuery rather than raw JavaScript. However, it is always a good idea to have some JavaScript knowledge at least for the required parts.
For this reason, if you see any jQuery book out there, most of them have a chapter or index regarding the "Basics Of JavaScript" or "JavaScript for jQuery".
I am likely to be part of the teaching team for the web programming course at my University next semester and I was wondering what kind of Javascript assignment to hand out to the students. The course is not an introductory one from a programming perspective.
It is assumed that the students are familiar with OOP, data structures and algorithms, functional programming concepts and working knowledge of networking protocols (HTTP included). This is the first course in which they come in contact with JavaScript
I was thinking to give out something framework-specific (using jQuery perhaps) that involves DOM traversal, some animations and AJAX. The three questions I have in mind are:
should they use a framework or should I have them write vanilla JavaScript?
should I focus more on the functional programming part and on the prototypal inheritance part (more on the language than on working with the DOM)?
how do I automate testing for this? It's better if they have a clear idea on how they will be evaluated. Also, automated testing ensures objectivity and saves me time :).
Outcome
I made them do Tic Tac Toe as a jQuery plugin and the results were mostly satisfactory (70% of the students submitted, generally the submissions were ok).
To prevent copying code from the net, I thought out an API which they had to implement. At least, they'd have to understand the code they found on the net before copy&pasting it into the methods :).
I used QUnit for automated testing, but I also tested each assignment manually because this was the first JavaScript assignment they'd had and I wanted to give relevant feedback.
Thank you all for your ideas, they all helped a lot.
Cheers,
Alex
I think its useful for the students to know fundamentals about the language before working with frameworks. They need to know about JS Scopes, closures, prototypes, the memory model, and everything that makes JS unique.
After that, introduce them to frameworks and the DOM. They'll appreciate them much more since they'll be able to understand the implementation.
As for testing, automated testing might be easy if you have them generate a DOM that you can walk and validate. Mozilla might be able to help you out, esp with JSUnit. You can find info here
I always like the idea of making games to learn new programming concepts. You get a well-defined problem domain that's as simple or complex as you need it, and it's usually more interesting and fun to implement than other problems.
When I wanted to learn Ajax programming I used jQuery and Java server-side to implement the game of chess. It was a fun project, but pretty complicated (at least for me, but I'm primarily a server side programmer). I think something like Tic-Tac-Toe would be substantially simpler, and might be a good idea for a project assignment.
As for the 3 questions:
If this is the only JavaScript assignment, then I'd probably use vanilla instead of jQuery. But if they have a chance to do some assignments before this, I'd consider jQuery, because it just makes JavaScript so much less annoying, and it's also good to know jQuery for future employment possibilities.
I'd place an equal emphasis on both the language and the DOM, because the primary purpose of the language IS to work on the DOM, and the DOM does take some getting used to.
I think Selenium might work for the testing you're trying to do. JsUnit could also be used for unit testing the individual methods.
Start off with vanilla JavaScript to learn the basics. You don't want to create a group that relies on any particular framework that wouldn't know how to do things without it.
I would most definitely have them write vanilla JavaScript. It will encourage all students to better understand the abstractions that frameworks/libraries provide in particular environments i.e. for the most part, in the browser working with the DOM.
I highly recommend having a good text for the course. Object Oriented JavaScript by Stoyan Stefanov is in my mind a great text for learning the language, including some of the topics that many people have difficulty with (prototypes, objects, closures, inheritance, etc). I've read numerous JavaScript books and feel that this particular text best balances the core of the language and it's application in the modern client-side development realm.
You may then want to look at dissecting certain pieces of the source of a particular JavaScript library to gain insight into patterns and practices used in a real-world scenario.
I would have them write vanilla javascript AND also learn how to use jQuery. jQuery is javascript after all, and they need a working knowledge of the language anyway. They'll also need to become SWAT (skills with advanced tools), and I believe anyone not using one of the JS frameworks (or at least their own!) in today's environment is at a serious disadvantage.
See answer 1. I'd teach them about prototypal inheritance in vanilla JS, and about DOM manipulation in jQuery.
Automated testing could be achieved in several ways. 1: produce the correct output given some sample code to start with for the parts that deal with learning JS. 2: for the parts that deal with jQuery, you could provide a reference image for how you expect the result to look, provide an original document, and have them recreate the reference image using jQuery manipulation... sort of like the ACID tests http://acid3.acidtests.org/
Should they use a framework or should I have them write vanilla JavaScript?
To me, it is overwhelmingly import that people new to the language start with the language proper, not modified versions or advanced/fancy libraries that do a lot of the work for you. Besides, if you're starting off not working with the DOM, then you're not getting much benefit from using almost any library, as the bulk of most JavaScript libraries has to do with handling the DOM. Also, it's easier to spot "bad" or ill-performant code when teaching and learning in a "vanilla" environment since you don't have libraries abstracting away the nitty-gritty.
Should I focus more on the functional programming part and on the prototypal inheritance part (more on the language than on working with the DOM)?
Yes! On one hand, the DOM is not not that big of a deal; yet it is also the core of what JavaScript is used to interact with. For starters, I suggest that if you're going to be using a browser environment, you should initially avoid the DOM by using Firebug's console.* methods for output so that you can focus on the "functional programming part and on the prototypal inheritance" and other core concepts. After these core concepts have been covered, then start introducing the DOM. It's best to introduce the DOM later as time will need to be dedicated to cross-browser compatibility, which will only confuse the subject if you are trying to teach the core concepts in tandem.
How do I automate testing for this? It's better if they have a clear idea on how they will be evaluated. Also, automated testing ensures objectivity and saves me time :).
Before (and after) the DOM is introduced, you could use something like JSUnit. Also, see this question: Automated Unit Testing with JavaScript. Once you introduce the DOM, you may want to have the students generate a document that you can walk and validate as SB suggested.
I'm a GUI designer/interactive musician wanting to improve my programming chops. I already know the basics(variables, loops, arrays, if/else, some logic), but I'm looking to learn in a structured way. I've seen some great books/tuts on Python and Processing (and even Flash)that aim to teach the fundamentals of programming in a fun and accessible. I've drooled on these books and considered learning Python many times, but to be honest, I don't know if these languages could be usefull for me on a professional sense. I need something directly related to interactive interface scripting/programming and JS seems to be my best bet (I've been trying AS3 but the OOP stuff made it somewhat hard for me).
I know JS can be fun (Jquery is). But I just can't find learning sources that are as compelling as the aforementioned material. All I find are tutorials and books that teach web development topics, such as form validation and ajax. I've tried looking for JS game frameworks, but all of them seem to be built for experienced developers and lack documetation or begginer's tutorials.
So, any directions on finding the joy in JS? Perhaps suggestions on other UI-focused languages ?
Thanks for reading this long question.
Have you had a look at Head-First Javascript? It seems to me to be a programming tutorial that's not inferior to the best ones available for, say, Python -- sure, it deals with web programming too (while a Python-based book might not), but, why's that extra info a bad thing?
Javascript isn't so much a "joy" as it is a "necessary evil". jQuery just makes it less evil. Actually that's not entirely fair: part of the "evilness" of Javascript is just all the cross-browser difference, not the language itself (which is actually quite modern).
But like learning anything, I don't think it's all that fun if you're just learning for learning's sake. Even a good book, tutorial or other resource won't do that (at least for me). I find it far more rewarding (and successful) if I have something in particular I'm trying to achieve or do.
If you know basic control structures and syntax then you know enough to pick something and try and implement it. You'll get stuck along the way (a lot early on) as you try and figure out actually how to do things. You'll probably do some of them really badly but that's OK. All that experience gives you a useful context when you do more reading and can appreciate the actual problems that something is discussing or solving.
If you are really looking for the joy of GUI programming, then I suggest you C#. Get yourself VS 2008 or above.
Just imagine, you have a great GUI designers that allow you to script you layout through drag and drop, and all you have to do, is to fill in the proper event and the program will just run like magic. Hand coding is kept to the minimum
Any programming language popular enough to have books written about it that you've seen in stores will be professionally useful to you. I think you have a good approach in looking for something that excites you. If those Python books make your heart race, pick one up and dive in. If you find something else that you love, go for it. You're gonna need that love to get you through all the hard work and frustration of learning to program.
You might want to take a look at Tcl/Tk. Although the language is sort of arcane, and the library is at least in principle available in other languages, notably python and perl, the toolkit in its native language is really very clear and concise.
I think you want to work on web interface programming not GUI (windows forms)..
Jquery is the best way to go and when it comes to web dev there is no escaping from Javascript.. I try and comiple some good sites .. give me some time
I suggest finding the joy in JavaScript. It sounds to me like your market may be in the browser, in other words, downloaded applications aren't what you're looking for. If this is the case, you don't have much of a choice: JavaScript or Flash.
If you had trouble with OOP, I suggest you find the joy in that first. As the joy of both JavaScript and AS3 (as you already know) can only be found once you find the joy in OOP, which will server you far better as a programmer in general.
As far as books, I recommend, JavaScript The Good Parts by Douglas Crockford, who is widely considered one of the top authorities on the subject.
Ok this is an old post, hope this still be useful to you. Try this book: "Modern Javascript Develop and Design" by Larry Ullman, he's a great author with a very clear and easy to follow style. I have learn PHP basic, intermediate and advanced with his books, even some OOP, so I think this could be a great tool for your learning path.
I learnt HTML/CSS a good few years back, then PHP a little later. I've recently become interesting in web development again, just started playing with frameworks like Django and RoR. I'm curious as to how much time/effort I should spend learning straight JS before looking at frameworks. I've been reading through a let of articles called Mastering AJAX by Brett McLaughlin which seems quite good, but I'm seeing a lot of stuff (such as cross browser compatibility - even for things like XMLHttpRequest) coming up which look like they would be non-issues if using a framework.
So, should I keep reading through these articles and try to build stuff using basic JS, or should I just start looking into jQuery and the like?
Also, I've been watching a few videos regarding GWT from Google I/O. I've been learning Java over the last year, built a few medium sized apps in it. I'm wondering if GWT is something that's worth going straight to, along with gQuery?
Starting with the basics of JavaScript is a good idea, IMHO.
Read JavaScript: The Good Parts, by Douglas Crockford. Very, very good book.
You should also check out Douglas Crockford's web site.
I also had to come back here and mention this in an update:
Douglas Crockford presented an illuminating talk about JavaScript - past, present, future - at the Microsoft MIX10 conference earlier this year. You'll find the full video for Crockford's talk at Microsoft MIX10 - The Tale of JavaScript. I Mean ECMAScript.
No.
Just as when you are learning to program you are taught first C/Pascal then Java/C++ and finally Python/Ruby/Smalltalk/Lisp, and when learning any language you start with simple language constructs, you should first learn ECMAScript, then learn DOM and finally frameworks.
Why? Because you'll have a deeper understanding of the language, and will be able to debug things that might seem odd unless you've got that learning experience.
If you are a seasoned developer, you can speed up each phase, but don't skip them, or you will have problems due to not fully understanding the small oddities.
Javascript is an interesting and fun language, but can act rather odd at times (Date has bitten me a couple of times in the ass).
Use frameworks to avoid repetitive tasks and to simplify your code, but not as a starting point. Simplicity is a final goal, not the starting point, and frameworks are for that, simplicity, not for learning a language. Frameworks are intended for simplifying things for experienced developers.
Learning the differences between browsers (DOM implementations) will allow you to debug your framework. That is priceless.
I've been learning Java over the last
year...
Javascript is not Java. Never was never will.
Even if you can compile to Javascript from Java, it's still a framework, don't jump into it unless you already know what you are doing.
I think "both." Mix it up. Play around with a framework. You'll get stuck when you try to do something real, so you'll pick up some JavaScript to figure it out.
A lot of the good jQuery books teach you JavaScript along the way.
This is one of the best videos for beginner javascript developers that understand how to program in other languages:
It's a talk the John Resig did last year at Northeastern, most of it is devoted to talking about core javascript, then the last quarter of the talk jumps into jQuery:
http://video.google.com/videoplay?docid=-7485992465859932389&ei=jhZUSu73OpfSrQLgyYV3&q=john+resig&hl=en
It's actually a really interesting tech talk and presentation since he does live examples and Resig is pretty good at presenting.
Like others in this question, I also highly recommend reading Javascript: The Good Parts for a better understanding.
Yes, jumping straight to framework-based programming instead of DOM is a good idea.
I started doing JS before any major frameworks like jQuery came along, and was reluctant to switch at first, but when I first started using jQuery, it felt so good to be able to write selectors and stuff and not have to worry about cross-browser compatibility.
However, there are some areas of JS where frameworks wouldn't be available. One of them is in userscripting, where you have to make your script work on a site you don't control. Another such one is the use of JavaScript in applications such as XUL.
Overall, I suggest you start with some trivial JS applications, then switch to jQuery instead of going on to the complex topic of DOM.
What makes you think that the frameworks are the good stuff and the JavaScript is not?
If you ask me, I will say that JavaScript is a real fun language and you should learn it first. JavaScript has received bad rap because it was mainly used for browser scripting and those browsers were buggy making people think that JavaScript sucks.
Crockford says that JavaScript is the world's most misunderstood language.
If your prior experience is with PHP (or any non functional language for that matter), the concept of 'first class functions' will really give you an 'aha' moment. 'Closure' will be another tool which will simplify your code and will make you wonder why all languages don't have it. Prototype inheritance will show you that there are alternatives to OOP. I would definitely suggest that you learn JavaScript first before you jump to any frameworks. I must add that you will also have to learn the concepts (first class functions/closure/prototype inheritance), to use any JS framework efficiently as all frameworks exploit the features of JavaScript.
To learn JavaScript, get Crockford's 'JavaScript, The Good Parts' book and try to learn the language using a standards compliant browser (say Firefox [with FireBug], Safari, Chrome) without focusing on DOM manipulation. This presentation by Simon Wilson is also good.
Once you have a good feel for the language, move on to the next step i.e. manipulating the DOM. I would personally suggest that you try to do some DOM manipulation using bare bone JavaScript to get better understanding of the DOM and the pain points involved. [E.g., when I attach a method to onClick of event, 'this' doesn't refer to what I think it refers to?]
After you have suffered a little bit of pain by doing DOM manipulation by hand, move on to a JavaScript framework which removes all the pain and makes JavaScript fun again. Personally, I would highly recommend jQuery over other frameworks.
And if you have any questions while on your JavaScript journey, you can always ask them on SO! :) Good luck.
I wouldn't touch any framework in any language until I have good basic understanding of underlying technology. Worth type of coder is one that uses tool without a knowledge.
JavaScript has somewhat sad history but in its latest incarnation it's surprisingly powerful and even fascinating language. I say - learn it well, then use whatever framework suits your current needs
It depends on where you want to invest your time. Ideally, we're all expert in assembly language, but that's not realistic or practical. We have to pick our battles. Then generally we attack each other for picking the wrong battle, which we call "cargo cult coding."
Personally, out of all the things I could spend a lot of time banging my head against, the intricacies of cross-platform JavaScript seemed less interesting and rewarding than other choices, so I decided to jump straight to jQuery. I'm happy with how it worked out.
I had the same background as you. After 6 months of MooTools I found out that mootools was indirectly teaching me "vanilla" javascript.
I've heard people say that mootools feels more like plain ol' javascript than jquery (after all, jquery's tagline is "jQuery is designed to change the way that you write JavaScript.").
I'd recommend starting with a framework. Plenty of the best javascript developers use frameworks. Once you're comfortable there you'll likely be able to pick up the others frameworks and plain ol' javascript quite readily.
This question already has answers here:
Closed 13 years ago.
Duplicate:
What are some of the pros and cons of using jQuery?
Should I avoid using a JavaScript library while learning how to write AJAX client code?
I've read it so many times... "I'd learn JavaScript before learning something like jQuery" - but is this really necessary for every situation? Sure, some people like to know what's going on under the hood, but are there any serious negative side effect of heading straight for jQuery tutorials/books? I want to learn something in my spare time and I've decided on jQuery (or JavaScript if anyone can convince me strongly enough).
jQuery is a library, not a language. You've essentially said, "I am thinking of learning how to write English songs. Some people say that you should learn English first, but I'm not convinced that it's worthwhile, I just want to rock."
You can probably still pick up jQuery without learning JavaScript first, but you ultimately will understand nothing of how jQuery is actually working and likely just come to accept that it's magic. Good luck when jQuery breaks or doesn't work how you expected it and can't figure out why your code is broken.
JavaScript is a beautiful language, and worth learning in its own right. Start here: Eloquent Javascript.
The reason of the typical recommendation "learn JS before jQuery" is because you'll find yourself too many times asking yourself how some jQuery snippet works, when it's not a problem of jQuery but JS syntax / etc (e.g. closures).
Go for JS, you won't be disappointed.
That's like asking if it's worth learning learning Objective-C before using Cocoa. It's kind of a weird question, because Cocoa is in Objective-C, much the same way as jQuery is written in JavaScript. When you learn jQuery, you learn some JavaScript whether you like it or not.
I think what you're wondering is more along the lines of "should I learn the underlying JavaScript that jQuery bypasses with its core library and plugins?" It depends on the circumstance, of course; if you need code in a hurry, you're much better off learning jQuery alone. But since your goal seems to be to learn something in your spare time, I personally think it's a good idea to learn basic JavaScript before diving into jQuery:
If you ever need to figure out how the internals of jQuery works, you'll need to know core JavaScript. This is especially important given how many jQuery plugins are out there.
If you ever need to extend jQuery or plugin functionality, you may have to know more detailed JavaScript.
If all you know is jQuery, you'll find it harder to work with other frameworks and/or vanilla JavaScript if you ever find yourself in that situation.
There is no question about it. jQuery is JavaScript. You'll be handicapping yourself severely if you jump straight into jQuery. Your code will be slow and unmaintainable. jQuery is an API, it's not a language.
In fact, you could try jumping into jQuery but I doubt you'll get very far without being frustrated with hurdles that would be otherwise trivial. At the very least, you should understand the concepts in Re-introduction to JavaScript.
It's very good advice actually.
The problem is this. Javascript doesn't work the same way most of the other popular languages work. If you dive into Javascript with the idea that it is similar to Java, C#, Perl, PHP, etc, then you'll end up thinking Javascript is a bizarre, inconsistent mutant language that makes no effing sense whatsoever. This isn't because Javascript makes no sense, it's because Javascript is different at its foundations. Javascript is an object oriented language, but it isn't class based, it's prototype based. The syntax is similar enough to where you could work just fine thinking Javascript was class based up until the point where everything goes horribly wrong.
Learn Javascript first, at least the fundamentals. It's not that difficult, you don't even need a special IDE or compiler since you can just use a browser or WSH. Learning the fundamentals of Javascript will definitely pay off if you're using jQuery.
A lot of learning and using jQuery comes for free to begin with and can be motivating as it provides an immediate sense of productivity. There does come a point however, where you need to understand JavaScript in order to use jQuery effectively or any other JavaScript framework for that matter. This is particularly pertinent for example, when writing plugins and utility functions.
For the same reason VB6 programmers needed to understand the Windows API to get anything done, and VB.NET and C# programmers need to at least know what MSIL looks like, you should be familiar enough with JavaScript to understand what jQuery is doing. There's a lot of far-out stuff built into JavaScript that most people never need to use, but if you don't know it exists, you'll always overlook good solutions to your problems.
JQUERY is just a library, not a substitue for language like JAVASCRIPT. You wont be going ahead in the field of the softare developement by just learning the LIBRARY. Basic understanding of the core langauge is always the better way to go. And of course, once you have that grasp, then you can and should definitley use libary like JQUERY.
I feel rather strongly that JavaScript is a more important concept than jQuery or any of it's siblings. These libraries are wonderful, and I can hardly imagine doing anything in the client without their help, but by themselves they only provide some tools and a bit of flashy polish. To actually accomplish any real logic, you will need a good understanding of JavaScript and the objects that are available in the browser.
Short answer to your question is yes if you ever have written anything in any normal language.
If you want to know why, watch JavaScript the good parts by Douglas Crockford (JS guru).