Review: Beginning ActionScript 2.0 by Derksen

This is the text of my amazon review, I gave it 2 stars. It is featured in the Shelf of Shame.

Updated now that I’ve plowed through the whole thing. Compared to the beginning, the later pages are better, I think there’s some real good information in this book and good tips. But it just seems that there’s a lot of typos, un-explained code and it seems just confusing examples. Also, if there was the one glaring mistake below that I caught, just because it’s something common to many programming languages, how many more did I not catch because it was something particular to actionscript? This is the first wrox book that I’ve been really disappointed in, generally wrox has been at least decent and often quite good. Sadly, I’d recommend you give this book a pass.

Read on for my more detailed impressions of the beginning:

I’m only several chapters into the book and so far I’m not impressed. It’s been difficult to get through the first chapters – they cover the basics of development, variables, control structures, etc..

There were several times where I simply didn’t agree with what they were saying or the point at which they were getting to topics, but just chalked it up to the inevitable differences in programming style. As examples, in the very beginning of the book, only a few dozen pages in, in a section targetted at complete programming novices they try to explain to you pointers and the differences between pass by value and pass by reference. A topic that can be confusing to even some knowledgeable programmers.

Or style issues where they suggest you initialize your associative arrays using the cumbersome (for initializing) array notation, but throughout the following pages they initialize nested anonymous objects to create data structures using the {} shortcuts. So… in the simple case where you are building a simple associative array (where you can use whitespace to make it very clear what you are doing) you should use this very explicit and wordy notation, but when you are developing more complex structures, you should use the simplified version?

Other simply minor things like that and maybe a few typos, but ok.. I figured, I must just be cranky while reading and was really picking nits for some reason. And then I get to their section on expressions and using boolean operators. Where they helpfully break down exactly what the flash player will do to evaluate your expressions. Except they are dead wrong in a very stunning way. They describe the process as an iterative process of simplifying everything until you get to a simple set of booleans and boolean operators.

So, in a 4 step process, in a paraphrase of an example, you get:

1: x >= 0 && x <= 10
2: replace the vars: 5 >= 0 and 5 <= 10
3: evaluate highest priority ops: true && true
4: evaluate remaining op: true

Which is all very clear and all very wrong. I couldn’t believe that Macromedia had removed the short-circuitiness of boolean operators from the language. I franticly jump to the index which reveals no hint of short circuit operators. Fortunately, a short google later brings us to macromedia’s site where they reassuringly describe how && and || are indeed short circuit operators.

While in their example, it makes no difference. Short circuit operators are used extremely often and are extremely useful. They do not simply evaluate both sides of the operator, they evaluate only enough to determine the truth of the statement.

So if you had something like this:

a == 1 || b == 2

if a actually did equal 1, second half of the expression would never be evaluated. Which, in this example doesn’t matter, but if instead you had:

a == 1 || some_long_running_function() == 2

it makes a big difference since the function is only called when a does not equal one.

This is an extremely important and subtle point which the authors seemingly do not understand.

I am trying to continue reading the book, but if it keeps on along this line, I may not be able to finish. I have some hopes that it will get better… and if it does, I’ll come back and rewrite this review.

blog comments powered by Disqus

Not Found

Sorry, but what you are looking for isn't here...