Help me take my intermediate Javascript to the next level - javascript

Sorry for the semi-rant here. I am hooked on javascript and want some direction on where to explore next!
I know the default answer is to just look around at sites and fire up firebug, but that may be inefficient as it's likely many sites have bad design and I won't be able to tell. I could use blogs and sites to follow, like http://ajaxian.com/, John Resig's blog, the YUI site, etc. Any comments are greatly appreciated! :)
Summary: Job needed to write a web app as a support tool. I begrudgingly took the task up to learn a bit of web stuff to implement a snazzy UI. (I come from a computer hardware background with all low level imperative stuff) I saw a jQuery UI demo and also came across an "ajax for dummies" guide pointing to jQuery, so I told myself I'd learn the minimum needed to do my damn job, but that would be it.
I bought the Jonathan Chaffer book Learning jQuery 1.3 and read the minimum needed to make my app work, but I was bothered that I didn't really understand the anonymous functions used, first class objects, etc. I did get an eyebrow raise from the interesting appendix on closures, and began thinking "hmm, that's cool..." So I bought the giant O'Reilly Definitive Guide and read through it. Wanted to know more, so I got the Douglas Crockford book (JS: The Good Parts) and went through his website - wow now I just blew away my previous understanding of JS prototypal inheritance (I was doing it the new() way) and damn, design patterns and unit testing frameworks in this language too? Javascript really must be more serious than I thought! With this newfound background I'm going through the jQuery library and dissecting its guts.
I don't know where to go from here though. Ideas I have but am not sure how to go about exploring include:
Get more into JS' integration into web architecture. I've only been doing basic XHRs, to serialize a few variables and do a GET to retrieve DB stored information, did XML->JSON conversion and back. But there's probably much, much more to make a app like gmail. Where to start?
Graphics and animations seem interesting. Saw some really cool demos from Google I/O 2009. I don't have a graphics background though so I'd need tips on where to start with the theory. I also don't know where JS' graphics capabilities overlap with Flash
Thanks guys! This community is the best (be kind to me, I'm an electrical engineer for my job, not a software guy)

The comp.lang.javascript newsgroup is a good place to advance your JavaScript. There are some seriously knowledgeable and opinionated people who regularly post there. You may need to brace yourself for the somewhat abrasive tone of some of the regulars though.

Google have made their javascript libraries public and open source.
These cover everything from UI widgets to event notification to unit testing.
Well worth looking at as a learning resource, a useful set of tools and as an inspiration as to what you can actually do with Javascript
It's called 'Closure' and is available here

Practise, practise, practise.
Ask lots of questions.
Try answering other people's javascript/jQuery questions here on SO. Examining how different people tackle problems can open your eyes to new methods and ideas.

Related

resource for javascript without jQuery

Is there any repository of code snippets, tutorials, whatever, that concentrates on pure JS, without the use of frameworks?
I first approached javascript through scriptalicious then jumped to jQuery. I am now a seasoned jQuery developer, and I've done quite a lot in jQuery throughout the years.
My problem is, I've almost never coded in pure JS. By the time I got advanced in coding in general (I mean, cross-language), my JS coding style relied already heavily on jQuery.
Plus, each time I research a solution for a problem, the first results (or pages of results) in google involve jQuery, or, more rarely, another Js framework. Which leads me to this problem: since I have developed a lot of custom plugins, some fairly complex, for jQuery, I am quite sure I do know a lot of JS. But I can't tell the difference!
So I decided that from now on, and as long as I feel the need, I am going to try to use pure JS, at least at the beginning of each project (leaving myself enough time to revert to good old jQueryScript if I get stuck). My problem is I am way too advanced to follow beginner's tutorials. I would like to know if any of you guys has a suggestion for a place to begin my training. Some website where I could learn advanced JS, without frameworks.
I actually think Resig's book, Pro Javascript Techniques would be a great fit. I read it a while ago and my memory of it was that he walked through a lot of the kinds of cross browser issues one can experience with Javascript and talks about how one could create code to help remediate those issues.
Ultimately that thinking is what jQuery is all about, but this book is not a jQuery book at all, more focused on JavaScript, approaching the same kinds of problems jQuery makes you not have to think about.
Might be a great fit for where you are, and it is by no means a beginner book.
http://www.amazon.com/Pro-JavaScript-Techniques-John-Resig/dp/1590597273/ref=sr_1_1?ie=UTF8&s=books&qid=1310240944&sr=8-1
If you want learn more about JavaScript in general and really master it, there are two books that I would recommend:
JavaScript: The Definitive Guide
JavaScript: The Good Parts
Both are excellent resources with great depth and cover fairly advanced topics.
If you would like to explore the possiblities of JS outside the browser and explore some cutting edge JS then take a look at the Node.js and CommonJS projects.
I recommend using this Google group:
http://groups.google.com/group/jsmentors

Looking for good physics/maths/algorithm learning resources for JavaScript

I have been playing around with JavaScript and Canvas for a while.
Very often when I dissect a code people have put on the web, it is really hard to understand the logic and algorithm behind the code if the code is poorly commented.
I would like to apply physics and maths to my code.
Are there any good articles, resources hub or books I could learn more about it?
I am aware of few good physics library out there such as Box2D. However I am hoping to learn the basics rather than using the library blindly.
Foundation HTML5 Animation with JavaScript by Keith Peters and Billy Lamberta is a really good book. I just started reading it. So far it is great. It covers many formulas and in-depth explanation on that. http://www.amazon.com/Foundation-HTML5-Animation-JavaScript-Lamberta/dp/1430236655
You could have a pretty thorough read on Google Books.
http://books.google.co.nz/books?id=KZTIFYMLShYC&printsec=frontcover&dq=foundation+html5+animation+with+javascript&hl=en&sa=X&ei=XZhiT7q3L8eaiAfh0_DfBQ&redir_esc=y#v=onepage&q&f=false
After some research, I think the Processing community has very good learning resources when it comes to advanced animation with physics and maths.
Check out this tutorial on vector.
http://processing.org/learning/pvector/
It is really useful and easy to read.
Definitely recommend everyone to look out for (soon to be released) The Nature of Code book by Daniel Shiffman - http://natureofcode.com/
Looks promising.

Should a web designer know JQuery?

I have been doing web designing for quite some time. My question is:
Should a web designer know JQuery at all?
Thanks
Not necessary but it is good to have that weapon in your web design arsenal if you want to make your web pages full of life.
In fact, Jquery has been made such that it becomes very easy for the designers to get started with it. For example, see its selector machensim, it is pretty similar to CSS selectors, something designers are always used to.
For example, Chris Coyier is famous web designer and guess what he knows JQuery and he creates amazing lively pages.
Finally, have a look at this great resource:
jQuery for Designers
Most of the people I know with the job title "Web Designer" (as opposed to "Web Developer") are concerned only with design and not with the technical details of implementation.
So, for their jobs, it is important to know what jQuery can make possible (i.e. nothing that they shouldn't already know is possible from a broader understanding of what JavaScript can achieve), but not how to use it.
More knowledge is always good, but a designer would probably be better off learning more about subjects such as usability, accessibility, information architecture, colour theory and so on first.
My personal view is that a web-designer shouldn't be expected to know how to program in jQuery. However, I do think they should:
Have a good awareness of what jQuery is, what it is useful for and how it can be used appropriately to enhance a site. This also means understanding what cannot be easily done with jQuery. Be aware of the possibilities and the limitations.
They should be able to integrate and style off-the-shelf plugins that don't require much more than following basic instructions.
A good designer must keep up with how jQuery is being used "out there" in the web, enabling them to see how it can enhance interfaces and solve common problems. Like everything in the fast-moving world of the web you need to keep on top of the trends and also be able to distinguish between fads and genuine innovation.
HTML is about structuring content
CSS is about presenting your content
JQuery is about behavior and interaction with content
A good designer should be able to deal with challenges in all 3 areas.
First, some traditional analogies:
Should a race car driver know how the race car engine works?
Should she know how to fix it and tune it?
Should she know how to improve the engine and design a new part for it?
The answers:
No. Not necessarily.
Could it help, in certain situations, to:
increase productivity,
make html and css cleaner,
make better visual design decisions,
make better interaction design decisions,
better understand what is possible to design (improve creativity)
Yes. Yes definitively.
Web Designer should (must?) know jQuery exist. Should also know its basic capabilities so that his designs could include some cool stuff that is really easy to do with jQuery.
I wouldn't expect much more from a designer.
No. I don't think it's a part of designing if you know its additional knowledge you have & it also helps you some other way. But i think javascript & javascript libraries are not a cup of tea of Web Designer. I think you should concentrate on CSS, HTML & if possible FLASH.
If you're trying to get by in the computer industry by learning as little as possible, I think you're setting yourself up for career suicide.
Given two web designers of approximately equal design ability, whom would you pick for your project? The one with Javascript knowledge or the one who doesn't?
If a web designer is a programmer or want to be one, yes. But if not, he/she should not learn it, separation of concerns. I wanted to close this question, seems not a programming one, but I'm interested to read others' ideas :-)
But based on Sarfaz provided link, i think you should learn it. jQuery seems, is like the Excel Macro of web, you need to learn some Macro programming in order to spiffy up your spreadsheet(aesthetic-wise and functionality-wise), in the same vein that the best way to spiffy up your website appeal is by using jQuery

Finding the joy of Javascript or searching for another UI-focused languages?

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.

Learning JavaScript... Should I skip straight to the good stuff (the frameworks)?

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.

Categories