What javascript frameworks should I become familiar with? - javascript

jQuery has served me well, it has given me an excellent introduction to Javascript but now I want to move onto something else. A good developer has a good knowlege of lots of different technologies.
So what frameworks should I move onto? I just want something good to put on my CV. There are so many out there and they all more or less achive the same thing. But because people have their own preferences I want to be as versitile as possible for other peoples sake.

jQuery is incredibly easy to use even for a beginner, very extensible with tons of useful user-created plugins and useful even for advanced scripting. It's made javascript accessible to me, and that's saying something. It's fast and tiny. I believe it's the top dog for a reason.
But Ext also looks promising for business applications:
http://www.extjs.com/

Personally, I like JQuery, too.
You can learn prototype or mootools.

I just want something good to put on
my CV.
Well if that is your goal..., you should probably go by popularity.
In order according to this study:
Prototype
JQuery
MooTools
YUI
Rest is insignificant

I would say GWT (Google Web Toolkit): although not strictly Javascript but definitely very useful and productive.

Take a look at Prototype. There are tons more out there, but really they offer the same basic functionality:
A method to bind methods because of javascript's silly way of handling this.
Sane way to do AJAX.
Helper DOM look-up functions like $ for jQuery.
So I expect that once you know two you can start to use others pretty quickly.

None. You can't really learn Javascript by only using libraries, so I suggest that you take a stab at learning the language itself.

I think the differences between jQuery and prototype and the most other frameworks are quite small.
If you want to make a lot of GUI stuff you should definitly take a look at ExtJS. The Api is very clean and easy to learn and you can do a lot with it.
Another interesting framework for GUI stuff is qooxdoo.

Related

Is there a small css 1 javascript function/library to retrieve elements?

Also do you know of some useful javascript tutorials?
Also is there a tutorial that explains the jquery library line by line?
Lots of information available at jquery.com, including How Jquery Works, a list of Tutorials, and the API documentation. For general javascript stuff, I find that w3schools.com has a lot of information on learning javascript, along with the ability to try things out yourself. JSFiddle can be useful for trying out code, including frameworks, as well once you have a better handle on what you're doing.
For the first question:
Look at document.getElementById, document.getElementsByTagName, and document.getElementsByName
Google is your friend, here...
I recommend you actually learn JavaScript, the magical language that is magical, before you start wandering into the realms of jQuery, as in my opinion, you should learn the basics before you have things become simplified for you.
I should note that I do not hate jQuery users, but I believe that learning simple/traditional DOM manipulation is important. Frameworks can come later.
Make a good understanding of Javascript to understand jQuery and other magic libraries.

Does it make sense for software developer to use jQuery when learning Javascript?

It's often claimed that learning a lower-level language is a good foundation for any new developer. What about an experienced developer (say a C++ or Java guy) learning Javascript? in the same way should he learn using the raw language so he understands what's going on, and learn JQuery later, or use JQuery from the start as 'part of' Javascript?
I think it's worth spending a bit of time working on JavaScript without jQuery so you can appreciate just what jQuery brings you. But most of what you'll be learning in JavaScript (getElementById etc.) will be replaced by better jQuery functions, so don't spend too long in pure JavaScript.
I guess the important thing to realise is that a lot of what you do in JavaScript is actually just working with the DOM API. The JavaScript language is great, but the DOM API is RUBBISH. jQuery doesn't really abstract the language, just the API. So the distinction isn't between using JavaScript or using jQuery, it's more about using the DOM API vs using jQuery.
It's always good to understand the basics of 'raw' JavaScript. I would recommend learning basic JacvaScript first, then jQuery. It'll make jQuery easier once you know the basics of the language, and there are still quite a few scenarios where it's preferable to do parts of a code in regular JavaScript than the jQuery way.
You could still try to learn about both in parallel, but either way it is still important to understand JavaScript to really understand appreciate jQuery.
I am pretty new to JavaScript myself, and I had a few months to learn raw JavaScript before finding out about jQuery. I agree with GSto that learning raw is good, but don't spend to much time in it before looking at a framework.
Apart from that, I strongly recommend anyone building in Javascript to pick up a copy of Douglas Crockford's JavaScript: The Good Parts. Read it back to back and then keep it close to your computer!
JavaScript differs from C-like languages quite dramatically at some points...
EDIT: Crockford held a great talk at Øredev 2009. They have the whole talk in video on their site.
Learn Javascript first and about DOM, object literals, closures and currying. When you master these things you are ready to use a library.
If you want to be a good web-developer who knows javascript, then do not touch jquery for at least year. It will corrupt you. Seriously, I've seen too many people who claim that they know javascript but are unable to iterate through an array without using jquery.
I think you should learn raw language before jquery or another framework. If you do, cou can learn jQuery basis wery quickly.
I learned JavaScript before I did anything with jQuery and I would recommend the same to any one thinking to learn JavaScript, as this would allow you to move to another library or use raw JavaScript if you found that jQuery wasn't really suited to what you need or if you simply didn't like jQuery.
There may be some cases in which using raw JavaScript is better suited to what you want to do.
It's very important to learn the language itself, and somewhat important to become familiar with the issues faced by things like jQuery in making the programming environment more uniform across different browsers. However, except as exercises for people who have the time, attempting to re-implement the facilities that modern frameworks provide is a pretty bad idea.
A benefit of learning a modern framework is that they generally encourage the exploitation of the native power of Javascript, and avoid trying to make the language look and act like something it isn't. You have to develop a good feeling for what anonymous functions are and how they work, for example, in order to really use Prototype or jQuery or just about any other framework effectively.
Finally, reading the source code of a good modern framework is wonderfully enlightening.
Think of JQuery as being an abstraction that just happens to be built using Javascript.
Most things that you need to do can be done elegantly with JQuery.
To use JQuery effectively it is more important to understand the DOM, Events and CSS.
It helps me to think of JQuery and Javascript as being different paradigms even though we all know that JQuery is written in JS.
I came to Javascript from a C/C++ background and it took me a while to really get to grips with the object model first-class functions, inner functions and closures and prototypes.
JQuery is much clearer, easier to follow, and more powerful once you understand what it is that you are manipulation (i.e. DOM, Events, CSS).
So I'd learn JQuery first and fill in the Javascript gaps as they appear.
Don't forget that document.getElementById is still the fastest way of getting elements. So if you do simple stuff and that's sufficient so why use a library?
Read what Joel Spolsky says about abstractions. What happens when your abstraction layer leaks? Do you know why the problem happened, or what you can do to fix it?
I would start learning the javascript syntax and usage first, but don't focus too much on the different functions, as a lot of them will have better jQuery alternatives.
The answer - both.
If you are working on something professionally and have a deadline... JQuery. Then go home and learn the internals. JQuery is very powerful and there is no need to reinvent the wheel. Sometimes the best code you write... is no code at all.
Now that being said, its always a good idea to understand your code and the "black majic" that happens under the hood. This helps to decide which JQuery method or selector to use for the best job... measure the pros vs cons.
You should do both at the same time. Learn javascript loops, types, prototypes and just forget the DOM methods because jQuery is more elegant for that.
You should learn basic js first, variables, loops, functions, closures, inheritance, and js design patterns. If you're already a programmer, you can skip a lot of stuff. jQuery is not a language. Once you know that, then jquery is a tool, that mostly helps you abstract differences between browsers (and provides another dialect of js). I don't use jquery, I use ext-js (another tool, another dialect), so I would caution strongly against learning jquery as if it were a language.
If you're going to work with the DOM (as admittedly most do, since most Javascript is used for client-side web development), then JQuery will be helpful.
However, don't confuse it with the language Javascript - JQuery is just another library for DOM access, albeit a very ubiquitous and imho great one.
I'd say it's somewhat analogous to asking if it's wrong to use Win32 or some other platform API while learning C++.
jQuery is just one of several libraries out there. What are you going to do if you don't use jQuery or the company you work for doesn't? Using this library does carry some weight, too. Are you going to always use it even if you only needed one minor feature?

MooTools and JQuery Side by Side

I just inherited some web pages which uses MooTools. I never used MooTools. Now I need to add some functions on the page, I wonder if it's a good idea to use jquery and mooTools on the same page?
Basically, I have 3 options,
Convert the pages to JQuery, which I have to learn MooTools to do that.
Write new functions in MooTools. I have to learn even more MooTools to achieve this.
Use both on the page.
Your opinion will be appreciated.
Opinion: Learn MooTools and then move on with it. Sounds like a great opportunity to learn something new. Why introduce an entirely new library with addition js bloat if you don't need to. If it'll solve the problem you're golden.
MooTools is a perfectly solid and acceptable Javascript library and I'd recommend you add it to your list of known technologies rather than tear it out and replace with JQuery. Mixing the two is not a good idea as you're likely to encounter obscure difficult to debug conflicts.
JQuery has had all the press of late, but it's by no means cut and dried that it beats every other library hands-down. Far from it. You might even find you prefer MooTools :-)
ADDED: For what it's worth my personal experience is that MooTools seems to play alongside other javascript code more nicely than jQuery. I've been handling several sites of late which have mixed in MooTools with various other pieces of Javascript for different effects/functionality and it's all seemed to play along together with minimal issues. OTOH pages that use jQuery tend to use jQuery versions of everything. YMMV of course.
Personally, I'd recommend not using both, as there are strange conflicts, even with jQuery.noConflict(). Go with one or the other.
If you do end up using both, be sure to use jQuery.noConflict() to ensure that using the $ doesn't conflict.
Using jQuery with Other Libraries
i'd say, depends on how the code is structured and what you need to do. mootools does render itself to easy refactoring and extending (this is, after all, partly the reason it exists) but it takes a while to figure best practices and so forth.
however, your learning curve from vanilla javascript or jquery won't be too steep, especially so if all you care about is DOM mantipulation, event handling and effects. things get more interesting when you decide to write / extend mootools classes and venture into prototyping - but you may not have to do that...
there are some pretty good tutorials around for most things as well as some demos on doing things through jquery and mootools (equivalent ones). http://jqueryvsmootools.com/ is a good example on how the same task can be done through either one, i'd recommend reading it before deciding.
whatever you decide, it is a bad practice to use two frameworks (when you can do without).
It depends on how big a project it would be to convert to jQuery, how much of your job is maintaing these pages (vs other pages that already use jQuery), what the urgency is for your first set of changes, etc...
It comes down to a cost comparison: how does the cost to your business to convert them to jQuery compare to the cost to the business for you to learn mooTools (and maybe keep both mootools and jquery in your head at the same time).
The only thing I can say for sure is don't do option 3. This isn't necessarily because it you can't make it work (and there will be challenges), but because you'll have to learn mootools to properly maintain the pages anyway. Once you do that, you may as well just keep them mootools rather than re-write everything or try to mix frameworks.
Personally I'm inclined to say convert it jQuery, since I believe jQuery is eventually going to corner the market. The implication then is that it will convert to jQuery at some point, and so the long term costs to business are probably best optimized by doing the conversion earlier while there's less to convert and mootools is still relevant so you can easily get help with the conversion. But that's certainly arguable.
jQuery and Mootools basics are close enough that moving from one to the other isn't much of a headache.
Whenever I'm given the choice between the two, I lean towards Mootools - especially if I'm intending to do any sort of effects or animations. Mootools's base FX libraries are far more robust and generate better results cross-browser in my experience.
Like others have suggested, you could take this opportunity as a learning experience. If you're satisfied with jQuery and don't feel the need to learn another framework, port the code over. You can't really go wrong with either in the end.
Since you're more comfortable with jQuery, I would just call jQuery.noConflict(); first thing, and write the functions in jQuery. That is, of course, if time is a factor.
There is a project that twists and prods Mootools to make it look like JQuery (a wolf in a sheep's clothing... or a golden coin painted to look like silver...)
I certainly think you should learn Mootools, but that might help.
I agree with those that are in favor of learning mootols, but i think that is even better if your take that decision because you finally think that learning mootools worth it.
So i think it would be nice to have some research over mootools capabilities.
I like this articule about this subject. And I think it can be useful for those reading this thread.
http://jqueryvsmootools.com/index.html

Is it worth it to use jQuery for Ajax instead of building your own JavaScript?

Aside from the framework, is jQuery worth using rather than creating your own javascript? I've always debated if the framework was better to use than to create your own calls. Are their disadvantages of using it?
Sorry for beginner question, I'm trying to feel out if it would be better to use this and create some of the ajaxish workings of my site rather than develop it from scratch.
Are there other frameworks out there that would be better to use to create an ajaxish website?
Yes, jQuery is worth it. I speak as someone who resisted using any library for a long time, then finally saw the light.
I do recommend that you build some hand-rolled Ajax interactions before you dive into using jQuery for Ajax, so that you understand exactly what is happening with Ajax. Once that's achieved, though, let the library do the dirty work.
jQuery (and most other framework) are for making difficult things simple. It keeps you from having to write cross-browser compatabile code. It keeps you from having to write recursive methods to update multiple dom-elements. It basically cuts your development time down substantially, and saves you a lot of frustration.
Stackoverflow Archive:
Which Javascript framework (jQuery vs Dojo vs … )?
Great discussion (with lots of involvement) over various javascript frameworks. It will benefit you to browse this in depth, or even at a cursory level.
When should I use a javascript framework library?
Which Javascript Framework is the simplest and most powerful?
What JavaScript library would you choose for a new project and why?
Which Javascript Ajax Framework is most powerful and very lightweight?
Which javascript framework can be used for all browsers?
If you like reinventing the wheel, write your own. For me, I prefer to spend my time focusing on solutions rather than lines and lines of javascript code. I'll use JQuery to save resources and frustration
One thing I want to add is for the past couple of months, I was trying to fill a web developer position for my team, and it proved to be a difficult task.
Lots of folks knew how to use a JS framework (JQuery, ExtJS, YUI...), but once outside of the framework, they found themselves in an unfamiliar ground. I had a self-claimed senior JS developer with over 10 years of experience couldn't tell me how to use function.call() or function.apply() or how to implement simple inheritance in JavaScript.
Framework is great and definitely useful, but you will also want to make sure to know how to implement the basic OO concept and DOM manipulation without the framework.
BTW, we use ExtJS and if you are starting to pick a JS framework, you may want to look around to see which one suits you the most.
jQuery is a big project with many users. By that nature, it will be better tested than anything you write by yourself.
It is a great framework for most uses I've come to need.
Is there anything in particular you are trying to do?
jQuery helps you avoid worrying too much about cross-browser JavaScript issues, and helps you get things done quickly. As far as I'm concerned, the key reason for using it vs your own hand-rolled JavaScript probably is the "don't re-invent the wheel" cliché.
Apart from added productivity, JQuery's main plus is that it takes all (most) of the pain out of cross-browser testing.
There is no reason you cannot write your own code and splash in JQuery where needed. JQuery is incredibly lightweight for what it provides and you will quickly find that you can do most takes easier in JQuery (especially once you start using the plugins for it) than by hand. I am a big believer in not reinventing the wheel. The JQuery code is tested by tons of people and there are so many plugins to chose from I could almost guarantee that what I want to do has already been done before.
If you are starting with a clean site, now is the perfect time to take JQuery for a spin though, because if you do get hooked on it your code will be more consistent if you solve similar tasks using the same technique. Go give it a try :)
I would highly recommend using jQuery (or any comparable framework) over straight JavaScript. It just makes common programming tasks easier, most notably cross-browser development.
jquery makes js related work easier and more important standardised/compliant.
If you need re-assurance as to its use:
MS & Nokia are bundling it in their dev platforms.
Its compatible with many of the newest web technologies.
It has a large developer community supporting it.
There are many plug-ins available to aid RAD.
and more...
Give it a go!!
Definutly! Jquery wil save you a lot of time struggling over code and makes your code easier to read to non-experts.

Learning Javascript vs. jQuery

I got the Wrox.Beginning.JavaScript.3rd.Edition and wanted to start learning it from scratch, then my boss came along and said that why bother, learn jQuery.
Can I understand jQuery and work with it although I am a newbie and have limited knowledge in ASP.net, vb.net, some C#, and basic HTML?!
jQuery is javascript. I think you're on the right path. Learn javascript well and you'll be able to make better use of jQuery.
So what's your question? JQuery is a framework built on the top of a language JavaScript. To use JQuery confidently, you should get familiar with JavaScript. JQuery contains a bunch of useful patterns and utils that mask the incompatibilities of the browsers. Using a JavaScript framework make sense as it allows you to focus on your problem instead of the problem of the JavaScript implementations of the browsers.
For further details on JavaScript frameworks, see SO question »Which Javascript framework (jQuery vs Dojo vs … )?«. For learning JavaScript, learn the good parts.
if all your manager is asking from you is to show and hide some elements, or fade in and out a couple of images, or request some data via ajax and display it then learning jquery and its api is perhaps all that you need.
but if you (or your manager) are concerned about performance, maintainability, code reuse and generally understanding what the *ell is going on 'back there' then learning the language itself is a safe bet.
I would suggest grabbing a copy of JavaScript: The Definitive Guide, which will give you a general understanding of what it is and how to use it, and much more. While you are at it, I also suggest John Resig's Pro Javascript techniques. This guy really knows his javascript inside-out (works for mozilla, author of jQuery, amongst others).
As for jQuery, you don't really need to buy a book. Just browse through the API and have a look at its source code. Perhaps you won't understand much, but there are some cool stuff going on that will make you think.
It is entirely possible to learn jQuery without learning every bit of javascript first. However, to be productive and and extend the functionality of plugins etc you will need to know javascript.
I would suggest that you do a bit of both. Continue learning Javascript but when you want to implement functionality make use of the jQuery library.
I would say the statement is akin to you reading a C#/VB.Net book and having your boss say "Don't bother, just learn ASP.Net". You really don't get much from the latter without the former.
JQuery provides a good layer of abstraction for interacting with DOM elements. You can do a lot of interesting things with it quickly and easily. But there are probably many things that JQuery won't do for you. You'll need to use regular JavaScript for that.
jQuery removes the need for many bad Javascript habits.
However, you will frequently need to know more than just jQuery to get non-trivial work done.
You'll need to learn both, but try to pick up habits based on jQuery.
jQuery is made from javascript. :)
It would be a very good idea to read the source-code of jQuery to enhance your overall understanding of javascript...
Definitely learn both at the same time :)
Good luck and have fun.
Maybe your boss is trying to save you some time learning the basics of Javascript and start you off learning jQuery right away but I think this would be a bad idea.
Understanding the basics of javascript is key to using jQuery successfully. jQuery provides shortcuts and solutions to problems (cross browser problems etc) but it is not a language unto it's self.
My advice, learn javascript, learn about handling events in different browsers, inserting in to the DOM and then start using jQuery. You will appreciate it a lot more and be a better coder for it.
If you already have an understanding of C#, you'll have a head start learning Javascript and it shouldn't be too hard to pick up. I'd stick with that Javascript book though, since you need to know Javascript to use jQuery. Once you are comfortable with Javascript, move on to learning jQuery. The jQuery docs are VERY helpful and can answer almost any question you have.
Good luck with learning it, it'll be worth it.
jQuery Docs
what are U doing? - ofcourse pure JavaScript is better =)
Libraries will alwas contain nonessential complexity, but they can save some headaches if they're not too bloated or already present on the end users' systems. Best use would be to learn javascript while using jquery, and then slowly remove the crutch of using jquery. While it's powerful, it does add significant overhead, nonessential complexity, and potential opportunities for abuse, just like flash. There are no silver bullets.

Categories

Resources