JavaScript by Example (2nd ed) |
Author: Ellie Quigley ISBN: 978-0137054893
Author: Ellie Quigley ISBN: 978-0137054893
It starts off with a fairly low level introduction to JavaScript - data types, dialog boxes, operators, conditionals, loops, and functions. It is not a particularly gentle introduction and it isn't very exciting. The ideas are presented in a "this does this" sort of way and there are lots of short examples. Another problem is that there is a tendency to be complete rather than kind to the beginner. So for example when functions are introduced so is recursion - there really isn't any need to treat this difficult subject so early. The book becomes more advanced with Chapter 9, which deals with objects but without really explaining the background theory. It concentrates on using the built-in objects - Math, Date etc.. Then on to browser objects and working with forms and input. Chapter 12 is about working with images and Chapter 13 covers event handling. For some reason Chapter 14 then branches out into CSS, which isn't particularly relevant to learning JavaScript. It also isn't really necessary for the next chapter which introduces the DOM. The rest of the book is a collection of odds and ends of topics - cookies, regular expressions and a trendy final chapter on Ajax. Each of the chapters has lots of short examples, plenty of detailed explanations and even some exercises for you to do at the end. The main problem with the entire book is that, as already mentioned, topics are introduced in an order that seems logical to the author rather than helpful to the reader. For example, bit-wise operators straight after arithmetic operators, the switch statement following on from the If statement and every single type of loop known to JavaScript before the basic idea or repetition has sunk in... The explanations also tend to the very short and while they are accurate and even well-phrased they aren't particularly user-friendly. For example, the do/while loop is introduced as: The do/while statement executes a block of statements repeatedly until a condition becomes false. Yes it does... and if you need a definition in a manual this would be excellent. But for a beginner's book surely you expect a little more? Of course there is the example with complete documentation and if you are happier with this "show me" style of explanation this may be a plus point for you. Personally I prefer to have the principles explained and a little more general discussion. The final drawback of the book is that it isn't object-oriented. It does explain the basic ideas and it makes use of objects but it doesn't really encourage you to structure your programs using objects, methods and properties. If you simply want to write very short embedded scripts this is probably ok, but it certainly isn't the way to work if you are more ambitious. Put simply this book doesn't teach JavaScript best practice. The final verdict has to be that this isn't a very inspiring book on JavaScipt and it teaches you a very limited way of using it. If this is what you want and you like having lots of simple examples carefully explained then this may be a book for you. If on the other hand you hope to really excel at the art of programming this isn't a suitable choice.
|
|||
Last Updated ( Friday, 03 December 2010 ) |