News for hackers. Stuff that matters.
Re:Flex: The Unix Geek's Ideal Flash Environment by snorkel on Thursday September 18, 2008 @06:31PM (#308663)
Please tell me that all those crazy redundant type declarations I see in AS3 code is optional too? IMHO AS1 started as a broken but usable language then AS2 and AS3 came along and added layers of Java-style bureaucracy for no good reason. AS should've been more like Javacsript with simple duck-typing and first order functions, etc. Flash developers are web developers who know and understand Javascript. Why on earth AS3 has to become so different then Javascript is beyond me.
Re:Flex: The Unix Geek's Ideal Flash Environment by bporterfield on Thursday September 18, 2008 @10:33PM (#308847)
Actually, ActionScript can be an extremely elegant and powerful language, when coded "correctly". The vast majority of Flex developers come from either a design or Java background, and as a result you find that most ActionScript RIA code adheres to strict application frameworks, static typing, etc...and rarely takes advantage of the interesting parts.

ActionScript has first-order functions, allows for dynamic typing, and utilizes class as well as prototype inheritance, even for built-in classes. This means you can do neat things to the prototype object associated with any object - even the Function object itself.

Just because the majority of people developing in ActionScript don't utilize the functionality doesn't mean it doesn't exist! Take a minute to look into the language yourself - you might be very surprised.

Re:Flex: The Unix Geek's Ideal Flash Environment by iron_ball on Friday September 19, 2008 @10:03AM (#309250)
Definitely. I sat in on a Flash user group meeting last Wednesday (shouts to any FlashcodersNY folks), where Alan Shaw gave a fascinating presentation on prototype-based inheritance in AS3. One of the tricks he showed off involved having one class add methods to the prototypes of other classes at compile time -- to get the same effect with the Java-like static-typed OO that AS3 <i>appears</i> to encourage, you'd need a veritable bouquet of Command and Factory structures. Instead, sprinkling a little prototype stuff in among the traditional OO allowed this particular trick to rest all in one class.

The same thing applies in a lot of areas of AS3 -- you can write a GoF-y 2001-Java-looking app with self-documenting code and doc comments and blah blah blah, and then if it's convenient, you can ALSO use first-class functions with currying and all that geek stuff for statements like (just an abstract example):

newArray = oldArray.map(convertFrom(value)).map(applyTransform(transformParams)).reverse().filter(namesFromLanguage(Language.GERMAN));

Re:Flex: The Unix Geek's Ideal Flash Environment by jamongkad on Friday September 19, 2008 @10:33AM (#309273)
Oh that is fascinating. I just recently installed Haxe on my Ubuntu a few hours ago. Hacked a swf after reading the documentation. (Which I believe is lacking.) Do you know of any good Haxe tutorials for a newb in ActionScript land?
Re:Flex: The Unix Geek's Ideal Flash Environment by iron_ball on Friday September 19, 2008 @01:25PM (#309405)
I'm afraid I don't know anything about haXe; it doesn't matter if it's a superior language if it makes it harder to collaborate with non-haXe Flash developers and to use Adobe tools such as the Flex SDK.
Re:Flex: The Unix Geek's Ideal Flash Environment by rtf on Thursday September 18, 2008 @10:56PM (#308859)
If you hate having redundant types, I highly recommend using haXe. It has type inference by first-usage so in most cases you don't need to specify any type. If you want to get around the type system it has untyped{} code blocks, casts, and the "Dynamic" type, all of which throw type safety over to the runtime interpreter.