Wednesday, February 17. 2010
Update 2010-02-17: Many thanks to James Ward for sending me the pointers to a couple of Jira Issues in the Adobe Bug and Issue Management System that cover the points below. I have added the links to these issues.
As a Java developer, who worked for more than a year with Flex I suffered from a couple of pain points - features that I am missing badly in Action Script 3.0. Here is my personal list of things that I wish Adobe would incorporate into Action Script 4.0:
#1: Abstract Classes with Abstract Methods (ASL-18)
Well, do I have to have to say something about that wish? Basically abstract classes are such an essential thing, I am still wondering how Action Script made it to 3.0 without them. Just documenting which Methods must be overridden is not enough. And the known workarounds are really... well... hm... forget it - this is a compiler thing, which cannot be checked at runtime.
#2: Generics (FP-811)
The Vector class is a good start - but it's not well supported in Flex 3 (keyword: data binding) and it's not a generic concept. There should be something like Generics in Java that provide type checking at compile time, but can also be used for any custom class, just like in Java.
#3: Threads (ASL-23)
Not every method can be split up into chunks and processed using callLater. Real threads or at least a simplified form are essential for enterprise grade applications. But that's probably the oldest discussion around Action Script which will never be implemented.
Well, although Enums can be easily simulated using classes, it's way more complicated when working with BlazeDS. When the backend relies on Enums in its data structures all enums must be wrapped in Java Pojos, before Blaze DS can handle them. And worse, even all the data structures that have references to enums, must be wrapped to reference the Enum wrapper classes instead.
#5: Non-public Constructors (ASC-2583)
Makes a singleton in Action Script much easier. Also a protected constructor would enforce the need to sub class a template base class.
#6: Ability to Catch All Errors
That was on my original list, but luckily there is a silver lining on the horizon.
#7: Operator Overloading (ASL-10)
Still missing it in Java and this is, where Action Script could actually beat Java. I don't want to have another equals method for comparing arbitrary classes for equality - I want to be able to simply override the == operator to be able to compare any two objects for equality. Or the + operator for concatenating two data structures. Just like in C++ or smalltalk.
#8: Method Overloading (ASL-9)
While ActionScript provides an easy way to simplify methods with long parameter lists using default values for parameters it's not enough to justify not having method overloading. I do not want to have to write methods like doSomethingWithString(value:String), doSomethingWithInt(value:int), doSomethingWithObjectA(value:ObjectA),...
#9: A True Hash Map Implementation
A HashMap is an essential data structure today. But currently it's hardly possible to implement a true HashMap for all generic ActionScript classes, as the base Object class, does not provide a template method that returns a hash code and therefore no instance can provide a hash code. Another problem is the ability to check for equality - see #7.
#10: Native Widget Style for AIR
According to Adobe, AIR should take over the desktop with local applications. However AIR applications will always look like alien applications, as the look and feel will never match the look and feel of the operating system. If Adobe wants to be taken serious on the Desktop, a native and accelerated Widget Style is a must. This could be done by providing wrappers for the basic components that are displayed using native UI elements (Cocoa, GTK, Windows) and by providing access to the operating systems color scheme.
Well, that is just my personal wish list. Most probably other Action Script developers have much better ideas or would prioritize my list in a different order. I would like to hear your ideas. Be creative and leave comment.
Trackback specific URI for this entry