Monday, December 08, 2008

Javascript woes

Javascript is used for a range of things, but mainly to help your browser do good things - load the correct video player, get the latest version of Flash, or most commonly to check that forms are correctly filled in. So, most of us have used Javascript at one time or another. Its most recent application area is in Web2.0 stuff - Ajax applications are applications that work without the user being required to hit a button - so this can provide live stock price updates, or product 'in-stock' values on e-commerce sites or let you know when your friends are online when you are in Facebook or Myspace etc. So yes, probably we have all benefited from Javascript.

So, what is Javascript? Javascript is the key language that exists in web browsers and is a bit difficult to write for because it is a) not always on and b) seems to be different for each browser... Having said that the main browser in use is Internet Explorer for the PC and Javascript is generally turned on. Javascript is a short version of Java, which is what they were aiming at initially and the reason they added the 'script' to the language is because they loaded the browser with so much code that all you need to do as a programmer is to script (tell the software what to do). Whilst the original Java was just too much to cope with and basically failed to work...

So, being an uber techy I decided to review what is hapening in the world of Javascript and anyway it meant could refresh my Amazon dependency that means I have to buy some books, any books, just books, books that I can read on the train, on a plane or up a crane.

This time I focussed on Javacript and basically having driven through six of the best I have to conclude that two were ok, none are essentially and the rest were just, frankly poor - nice ideas, but poor...

So on with the reviews - the worst of all has to be Head First Javascript. Honestly! 618 pages of fluff, you could probably condense the whole thing down to five pages and be done with. The style of writing is interesting, it looks like it would appeal to a five year old and from that perspective is probably a great place to start 'We think your time is too valuable to spend struggling with new concepts. Using the latest research in cognitive theory to craft multi sensory learning experience...' but knowing what I know, I find it difficult to find much that you could really do with it - great examples of what you could do, but not enough practical code that would stand modifying to suit your own needs. I cannot see how you can make anything with this book, although it does cover the principals - 20%

The second worst - to me anyway - was Javascript: The Good Parts, the premise of this is a good idea, that is why I bought it - it defines the parts of Javascript that are generally reliable and those that are not. It has lots of diagrams and could be useful to the extremely focussed Javascript programmer - virtually no workable code, and lots of theory, for me this was lacking in substance. Although this was the shortest of all the books - being 153 pages long, it is to me just half of a book. There is some code herein, right at the back without any work through, so it left me cold I am afraid.

Javascript the definitive guide - by David Flanagan, 5th Edition, Published by O'Reilly Media, Inc. Cover is White with Turquoise Animal on the front is a Javan Rhinoceros 994 pages. This tells a lot about Javascript - it is like a dictionary of terms. Dry as a bone, would take a month to read. This is reference piece really, something where you might be looking for something and discover something else, all very interesting, ideal website material! This should be a searchable database not a book. A tome where ownership could make you feel rather sage. I will learn from this, it will be helpful, it is essential, it may help you design an application, but that would be like walking through treacle.

Javascript & DHTML Cookbook, - by Danny Goodman, 1st Edition, Published by O'Reilly Media, Inc. Cover is White with a Turquoise Howler Monkey on the front, 520 pages. This is the nuts, hence the monkey I suppose. It has almost everything... starting with the usual stuff on DOM, strings, Numbers and Dates, but quickly moving on to the more interesting Browser feature detection, managing windows, frames and onto forms. From there it covers page navigation, style sheets, visual effects, HTML positioning, dynamic content and a final chapter on Dynamic Content Applications. Great stuff worth buying excellent reference material for anyone serious about Javascript web development.

Javascript Application Cookbook - by Jerry Bradenhaugh, 1st Edition, Published by O'Reilly Media, Inc. Cover is White with a Turquoise Hippopotamus on the front - you dont see one of those every day, 464 pages. Lots of depth in just a few application areas really, quite good in its depth, limited in its scope. A client side search engine, an interactive slide show - nice but not essential... Cookie based user preferences, a overly complex but lightweight shopping basket system, Ciphers, drag and drop email and context sensitive help... I am sure I will find a use for some of it somewhere - not immediately exciting, applications are a bit old, dry and past it really, although, essential elements of a web 2.0 website... perhaps.

Simply Javascript from Sitepoint - all sitepoint books have a good feeling about them, I have read on duffer, but most are pretty cool. By Kevin Yank and Cameron Adams, 405 beautiful pages, 1st Edition. First 4 chapters on essential knowledge necessary to understand the way that Javascript works. Then we romp into Animation and Form enhancements, this is the stuff, followed by Errors and debugging they guess right that by now not everything will work - so this is just perfect timing for those who are working through and bang we are into AJAX, now this is the nuts too! The book puts AJAX into Action, then an expert chapter looking forward into the possibilities with a nice rounding off with 30 pages dedicated to the core Java library, just when your appetite is whetted... Buy it!

In summary I think I need to know a lot more about Javascript. I had bought the books as I thought they would help me learn a lot more. One did... I think now I will turn to the internet and see what I can find on which I suspect is what I should have done in the first place. This could very well be a case where new media outshines. Although I do now have an exhaustive library on the subject and perhaps in time, they will become more relevant to me. I will report back with my findings...

No comments: