Wednesday, June 25, 2008

Flex Needs Some New Thinking

Anyone who's used Ruby or another dynamic language (I suppose Python is good, but I can't stand the syntax and whitespace-nazism) and started to really grok it and what you can do with a dynamic language with a friendly syntax generally feels a resistance from deep down in their soul-area when they have to go back to Java-land or worse.

I feel less of that resistance when I switch from Ruby to ActionScript via Flex, but it's still there. Especially since I know that a lot of dynamic capabilities are available, but bad for performance and confusing to other developers expecting the more common approaches.

I happen to like Cairngorm just fine, although a lot of people complain about its red tape and preponderance of boilerplate code and I would be happy to use something less bloaty. I like PureMVC as well, but I don't find it to be any better than Cairngorm at what people usually complain about Cairngorm for. There's nothing wrong with Cairngorm that a code generator and Prana won't fix for me, but I'm a little set in my ways, nothing against PureMVC at all.

In fact any of the other frameworks that are popping up as alternatives to Cairngorm, PureMVC, or Roll-your-own, like Mate and Swiz are mostly just cutting down on clutter, but using the same ideas. There's merit to that, but I want to see what thinking like a Rubyist could do for us.

I'd like to try to learn from the dynamic language community and try some new thinking and new approaches to solving framework issues, and it's good to see others thinking about it too:

Jay Fields has got a lot of experience from the Rails and Rails testing world and has some great thoughts on testing in Flex and on Flex in general that resonate with me. I'm excited to see some favorable views on Flex from the Rails community and I hope it continues so we can get some new thinking, new techniques, and get that stuff recognized and incorporated in the Flex community.


dan mcweeney said...

I am hoping some stuff that I've built that underpins my project will see the Open Source light of day. It is based on Rails' ActiveRecord implementation and shoe horns it into the Actionscript. The library provides dynamic finders, migrations and even simple has_many and belongs_to relationships for the local SQLite database in AIR.

Jonathan Branam said...

I totally agree with Tony on this. Adobe has grabbed the enterprise/Java mindshare with Flex, but they're not getting the Ruby/dynamic/functional programming mindshare, which is where much of the current web innovation is occurring.

Actionscript should be as concise as JavaScript if we don't mind the performance loss. People like John Resig (of jQuery fame) could really be pushing the envelope here. He ported Processing to JavaScript. We should have that in Flash!

Kevin Hoyt said...

In general, I think we (Adobe) struggle to find an audience with the Rails community. And believe me, it's not for a lack of trying. I have my own theories on why this is, ranging from cost, to being more open as a company (something we've made great strides on this year). I'd welcome any thoughts about how Adobe could better engage with the Rails (et al) communities. Please feel free to drop me an email (khoyt _at_ adobe _dot_ com).

Kevin Hoyt
Group Manager
Platform Evangelism

Tony said...

@Kevin, I didn't mean for this to be a knock on Adobe's ability to engage the Rails community, nor do I think that's something you need to focus on in those terms. I think if you make a good product (which you have) then people will use it, and Jay Fields' (not to mention my own) interest shows that you can attract people from the Rails community.

What I meant is for us to start to think how we can use this dynamic language we have to our benefit. Learning from what's possible in Ruby, which is a lot that's not quite as possible or friendly in AS3, can we start to do some cool stuff that gets rid of the red tape we don't need?

Can we start to make some of the frameworks that have grown around Flex a little friendlier? Can we start to do things we haven't even thought of before? Let's see... If we can, then a cool side effect would probably be more Rails folk's hearts and minds.

julien said...


I also use rails (since a couple of months only) and I really enjoy it as well, for the same reasons that you do (and I think I've only seen the tip of the iceberg), I love flex and like Cairngorm.

One thing that really helped me use Flex and Rails "easily" together is Peter Armstrong's Flexible Rails book, you probably have heard about it or even read it, but it just makes Flex and Rails development look really easy.

I don't know if Rails developers will start using Flex easily (though I could try to convince them lol) but Flex developers should really take a look and think about using rails (and hosting companies should also make it easier for everyone to be able to use it on their server).

I started using Flex because it really made ActionScript development look easy and more "dynamic" for me compared to what it is with the Flash IDE, a bit like Rails convinced me to drop PHP on the server side

I'd really be interested in a Ruby/Flex framework that makes it even more easier

Tony said...


Have a look at (shameless plug) RubyAMF:

Also, watch this space for news on another Flex and Rails book :)

julien said...

@Tony : thanks for the info :) I definitely keep an eye on the RubyAMF project page

Mike said...

I've never quite understood why Rails types believe that Rails is anything other than a (poor) rehash of of the Java app server model in another language... or why it's a particularly good model for Flex to ingratiate itself with. On the other hand it's easy to see why Adobe wants to appeal to the Java app server crowd (market share, available $$'s)

Having just spent a couple of days building a Ruby script that introspects on a Rails model and generates all of the AS code needed to build self-generating CRUD forms I can safely say that neither 'dynamic' language has a sufficiently mature MOP... given that Smalltalk and CLOS are over 20 years old I'm not sure what the excuse is.

Flex could stand to be a bit more flexible and consistent and Flexista's need to get out of the app server mindset... when we can run AS on the server we might really have something.