
Flex: The Unix Geek's Ideal Flash Environment - soundsop
http://benjisimon.blogspot.com/2008/09/flex-unix-geeks-ideal-flash-environment.html
======
abstractbill
There's also haxe (<http://www.haxe.org>), which we're using to good effect at
justin.tv.

~~~
rtf
That's awesome. Do you guys post on the compiler list?

~~~
abstractbill
I haven't yet, but I plan on it. I already have a few small patches I'd love
to get rolled back into haxe.

------
keefe
"For those who don't know, Flex allows you to write XML and JavaScript and
compile it to a .swf instead of using the traditional GUI timeline based
tools." uhm... you write ActionScript3, not javascript. Different beasts and
likely to remain so given the current fragmentation in ecmascript
recommendations.

------
there
flash, regardless of any development environment, is not ideal to any unix
geek.

------
jwilliams
The article is focused on developing Flex using Emacs, but probably also worth
mentioning that the non-free Flex development environment (Flex Builder) is
Eclipse-based.

I've never truly used it in anger, but I found it extremely good. It's US$250
or something last I checked.

If you're more of an IDE-type, worth checking out.

~~~
iron_ball
I'm an Actionscript developer by profession, and having recently moved into
Flex work I can strongly recommend both the Flex framework and Flex Builder --
at least, if you choose to create content for the Flash Player at all. The
programming model is worlds ahead of what Flash developers have been putting
up with for the past decade; they made clear and effective efforts to make it
work like the languages, frameworks, and systems professional developers are
already familiar with.

Since Actionscript 3 has optional static typing, and contains little-
documented but very real implementations of closures and functional
programming, it can be written as a Java-like OO language, as a Javascript-
like dynamic language, or as a clunky but at least workable functional
language; and the XML-based GUI-layout component, MXML, is surprisingly
powerful and consistent.

Even though Flash is where my paycheck comes from, I am not at all convinced
that it is the ideal format for most web content, so I won't argue with anyone
who hates it. But anyone who has avoided Flash because of its programming
model should definitely give Flex a second look.

(As for Flex Builder, I use it for its debugger and compiler, while doing
heavy-duty text editing in jEdit. I mean, it doesn't even have parenthesis
balancing, for chrissake.)

~~~
snorkel
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.

~~~
bporterfield
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.

~~~
iron_ball
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));

~~~
jamongkad
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?

~~~
iron_ball
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.

------
fuzzythinker
Ha, is this guy a joke?

AS elegant? I think it's the ugliest language next to java.

AS has deep roots in Scheme!??

Also, I know you can use javascript for Flex, but can you create a swf using
javascript?

~~~
apgwoz
I believe the original author of JavaScript went to Netscape with the promise
of doing "scheme" for the browser. It didn't happen, but he included some
ideas from scheme as part of it.

See
[http://Weblogs.mozillazine.org/roadmap/archives/2008/04/popu...](http://Weblogs.mozillazine.org/roadmap/archives/2008/04/popularity.html)
for a brief history.

------
dgreensp
Nice! I've been waiting for a write-up like this.

Because Flash has such good browser support, it's common for bits of rich
functionality on sites to be implemented with little SWF files, with or
without UI. Sound players, upload widgets, cross-domain sockets, even browser-
proof clipboard access. I do all my web programming in Emacs, and the text-
file-based development method he suggests is right on.

