« ACLU Emergency Town Meeting | Main | How to Really Scare Microsoft »

ActionScript

As part of my new job I've started programming in ActionScript 3. Its syntax is similar to JavaScript and is based around the upcoming ECMAScript 4 standard. The thing that has caught me off guard the most is the "variable:type" declaration syntax versus "type variable". It's only a minor thing, but I'm amazed at some of the subconscious cut'n'paste'n'edit keystrokes I have. I find this most prevalent when writing unit test code, where often you are creating similar but varied objects. The jump to home shift ctrl right keystroke doesn't help to change the type when it's after the variable.

One of those simple things that you don't really notice you are doing it until it doesn't do what you should. Joel Spolsky had a recent article taking about usability (it's a draft so I'm not going to link to it) and one quote from it was "Something is usable if it behaves exactly as expected." Right now my finger memory isn't that useful because it isn't behaving as expected. It isn't that there is anything wrong with it, as soon as I'm back in Java land it will be very helpful, but while I'm working in ActionScript it's just plan annoying :)

Comments

Ahh....no wonder you asked if I knew ActionScript.... I kid, of course.
I also realized that by having it be "variable:type" you can't get intellisense automatic variable names like you can in Java when using Eclipse. The normal Java intellisense can automatically create variable names based on the type, so typing "String " then hitting CTRL-Space will create a variable named string. However in ActionScript since the type is after the variable name, it would require ESP to do something similar. What an interesting automation fall-out from a language design decision.
Yeah, no automatic variable names, but I've heard good things about an ActionScript plugin for Eclipse that handles the other sorts of intellisense--yping, methods, etc. (Though I don't yet use Eclipse, I'm going to be moving to it soon). Try http://sourceforge.net/projects/aseclipseplugin/
I'm using the Flex 2 Beta 2 which has a Flex builder plug-in for Eclipse. It's still very buggy at this point but it is getting very good at intellisense.