ActionScript 3 Learnings

I’m learning a lot about AS3 these days. It’s not a bad language, and it’s basically Javascript for Flash. Among the learnings:

  • Actionscript is still really, really slow. About 50-100 times slower than C s my guesstimate, based on what I know about Javascript benchmarks.
  • getters and setter are very slow. It’s 20 times faster to access a variable directly than it is to access it through a getter.
  • I really, really miss arrays of atomic types. Array is an array of object-references (and smart pointers, even), and it’s memory-hungry and not fast.
  • ByteArrays are faster than Arrays and use a lot less memory. I’ll try to use them more.
  • I think in C. Even after two months, I’m still writing int i every time I should write var i : int.
  • I miss block scoping of variables. Especially in for loops.
  • The Visual Studio debugger blows the socks off the Flex debugger

Despite all this I’m starting to really enjoy coding in Flash and getting noticeably faster every day.