collections.immutable: Immutable collection classes for AS3

As part of writing a preprocessor for generating AS3 enums, I hit upon the need for a means of passing around a set of enums in a way that couldn’t corrupt the original data. After a bit of thought and digging around the core Flash/ Flex classes, I realised that:

  1. There are no immutable collections in Flash or Flex.
  2. Immutable collections are  fairly easy to create using standard AS3 and the magical Proxy class.

Continue reading “collections.immutable: Immutable collection classes for AS3”

Greedy Adobe to put profits before developers?

At the time of Adobe MAX last year, I wrote a post on the subject of AS3-based apps for the iPhone. Two things caught my attention at the time. First, it would be possible to use a Windows-based PC to develop iPhone apps. Secondly, Adobe would be releasing a version of the AIR SDK that contained the tools needed to build these apps. If you read the post now, and follow the links to the Adobe FAQ, you’d be forgiven for wondering what I was on about. The FAQ makes no reference to the AIR SDK, and instead says “The primary tool for developing iPhone applications using Flash will be Adobe Flash Professional CS5. We are also looking at adding this feature to other Flash Platform tools and technologies.”

Before you conclude the excitement got the better of me and that I simply imagined the bit about the AIR SDK, consider exhibit A: Mark Doherty. Continue reading “Greedy Adobe to put profits before developers?”

An AS3 language extension proposal: Java-style enums

Enumerations, or “enums”, are a handy language feature present in many programming languages. It’s what is often referred to as a syntactic sugar feature. What this means is that the behaviour of enums can be achieved using other language features, enums just simplify the process. To use another buzz-word, enums avoid developers having to write a lot of “boiler plate” code, ie code that is long-winded and repetitive and that is better suited to the compiler inferring or generating it for you. Not only does boiler-plate code waste a developer’s time, it encourages that developer taboo: copying and pasting. Copying and pasting of code is one of the greatest sources of bugs, and so anything that discourages it is a good thing. Unfortunately ActionScript 3 (AS3) lacks enums, so I’m proposing here a way of adding them to the language. Continue reading “An AS3 language extension proposal: Java-style enums”