February 1, 2007

Flex vs Javascript

I’ve been looking at 9 things you may not know about javaScript, and I thought it would be interesting (where appropriate) to see if ActionScript 3.0 shows the same behavior (where appropriate)

  1. (Binary Trees) - nothing to add here
  2. (Concat Performance) - counterintuitively, ActionScript is almost twice as fast with concatenation as it is with Array.join
  3. (Binding Objects To Methods) - works exactly the same in AS3 as JavaScript
  4. (Custom Sort Functions) - works exactly the same way in AS3 as JavaScript
  5. (AssertException) - similar. I created a seperate class, for clarity, and when you throw the exception it pops a message up on top of the app, which can be disruptive if you’re in production. I suppose you could turn off that behavior in production.
  6. (Static Variables) - ActionScript 3 has native support for static variables
  7. (Undefined, Null and Delete) - slight behavior change here. delete seems to remove a property, and both Alert.show() and Text.text reveal it as blank, instead of undefined.
  8. (Deep Nesting) - this one was the most significant difference - because everything in ActionScript3 is strongly typed, you can’t link a String to a TextInput.text element, for example. However, you can link objects to each other. For example:

if I have a Form a, with a FormItem b, and a TextInput c

I can do this:var linkTextInput:TextInput = c; // linkTextInput.text will always == c.text

But I can’t do this:

var textString:String = c.text; // if the user enters new text into c, textString will still contain the old text.

9. (FireBug) - there’s a built-in debugger in Flex, so none of this really applies.
Update: 2/2/07 - added #5, 6 and 7.

Update: 2/5/07 - added #8 and #9

Resolution Amnesty

I declare today, February 1st, 2007 to be New Years Resolution Amnesty Day.

In other words, you are hereby forgiven for not following up on your New Year’s resolutions.  You have a clean slate.   You need no longer feel guilty about not following your resolutions.
You have been granted another chance to start them up again.  No one will fault you for not getting started properly in January.  After all, New Year’s day was on a Monday, so it threw off your whole schedule.  January was a practice month.
I am offering you a second chance, a chance to re-engage and try again.

And if you make an effort today, even for fifteen minutes, you have created a new beginning.  If, tomorrow, after you’ve started work on that book, or that program, or that exercise routine and someone asks you “How’s that New Year’s Resolution coming?” You can honestly say “So far, so good.”