11 Sep
Coming from long term Java programming, I can see that I have gotten used to very good api design. It is not, that JavaSE and JavaEE doesn’t have their corners of bad api design. But working with flash and flex, I seem to come across strange and bad api design a bit too often.
The other [...]
Posted in Design, Programming by: polesen
9 Comments
11 Sep
I am confused. Is the Number class really a class, that I can create instances of and expect to have reference semantics etc. like the rest of the classes in ActionScript3?
Given this AS3 code:
var foo : Number = null;
trace("foo="+foo);
The compiler outputs a warning saying “null used where a Number value was expected“, but it does [...]
Posted in Programming by: polesen
7 Comments
22 Jul
ActionScript3 has the nice feature of a get and set keyword, usable for easily defining properties on classes, while still hiding the actual implementation.
AS3 also has the varargs feature, in the form of the …(rest) keyword. This can be utilized to create methods that take an unspecified number of arguments.
Sadly, I have been unable to [...]
Posted in Programming by: polesen
9 Comments
08 Jul
While I do like to write UI code in ActionScript3 within the flex framework, I also miss features from Java sometimes. One of those missed features is method overloading, the ability to have several methods with the same name, differing only in input and output types. This is not possible in as3.
Just Use Default Values [...]
Posted in Programming, Rich Internet Applications by: polesen
3 Comments
26 May
Being used to the excellent collection apis of Java, I come to expect that of other platforms too. The Flex platform has the IList interface, which amongst other methods, has the removeAll() method. Sadly, it is missing the addAll(Collection) method, so I am left to do this instead:
coll.removeAll();
var newElements : ArrayCollection = xxx as ArrayCollection;
for [...]
Posted in Programming, Rich Internet Applications by: polesen
8 Comments