Monday, December 17, 2007

Flex Sucks

I cannot wait for a long hiatus from working with Flex. Flex is one of those programs that can make even just adding two strings of text together a challenge. I was already frothing at the mouth from trying to get a data binding to acknowledge that I'm changing it, and then I tried to switch over to a simpler task to calm down. I needed to write a function that would check to see if a string of text was the last in a series. If it was, it would do nothing. If it wasn't, it would add a comma to the string. Super simple. However, it would return a blank string instead. It would not even run a trace statement in the second half of the function. After I screamed for a while, I determined that Flex was choking on a line of code getting the length of an array in the function. It didn't throw an error or do anything else. It just broke the function and failed silently. So. INCREDIBLY. LAME!!!!

Flex is supposed to make development easier, but in my experience, it makes development much more problematic and infuriating. I think I've easily spent 5 hours just trying to get it to acknowledge the change to a data source, and I still can't get it. I'm going to have to stop now. Seriously, I was seconds from hurling my laptop across the room. Flex sucks.

21 comments:

Isaac said...

Umm, lets get a beer. Then lets watch a hockey game, and in the first period we get another beer. Repeat process for each period, and follow up with "one for the road", except instead of the road, we'll use the Light Rail. It sounds like you need some vicarious violence.

Justin said...

I couldn't agree with you more. Flex is the worst language I have seen ever. I'm doing Flex project for some money and I realized that I will never ever do it again in my life no matter how much I'm gonna be paid for it. Flex sucks to the utmost!!!

devon said...

I'm right with ya. It reminds me of the other day when I was trying to hang a picture, but I kept hitting my thumb with the hammer. I'm never using one of those again. I don't know why they have such a wide user base - hammers are the worst tools ever made...

turbidity said...

Ouch, man. That's a bummer. I know that stings like the dickens. Now, I don't know what your skill level with hammers is, but I've found that having good quality tools can make all the difference. If you have a hammer whose head spins freely on the handle when you swing it, or one that deforms when you hit a nail with it, it's going to be hard to avoid hitting your thumb regardless of your skill level. I also highly recommend avoiding beta hammers, too. Make sure you have a tool that works properly and as expected, and you'll have a much easier time hanging pictures. Good luck!

brian said...

Hey dudes

First flex is not a language. MXML or Actionscript is more like it. If you don't know how to use the tool propperly then learn. Dont bash flex for your incapability of using it. Flex rocks although I prefer Flash to Author my flash content. Check out http:www.brianwiltshire.net/lab and tell me, does it really suck so bad.

turbidity said...

Yeah, the problem with Flex lies neither with MXML or ActionScript. You can do some really cool stuff with that. It's all about how it compiles or fails to and the bugs in its error reporting.

It's funny that you write today, since I had a prime example of Flex's failings today. As I was finishing up a project before a client meeting, Flex choked up and wouldn't compile because it couldn't delete an HTML page in the bin. I wasn't doing anything with that file, but I got rid of the file for it, though I had to close Flex to do it. When I restarted Flex, it wouldn't let me open that workspace. After some finagling, I got it to open the workspace, and now it wouldn't compile because the HTML file it had been trying to delete wasn't there, and it wasn't recreating it from the HTML template. Thankfully it was a long meeting and I was able to get things working again in time.

Now, perhaps I'm missing something, but when Flex spontaneously fails to compile or report an error or hoses my workspace, how is that user error?

Brent said...

And try doing a freaking enum with intellisense or type safety...

Hassan A. Al-Jeshi said...

I can't agree more. Flex really sucks. I'm doing a project now for a client with flex and it is way behind schedule, why?? coz this stupid tool make even the simplest tasks complicated as hell.


I would never ever do a Flex project again even if they give me big $$$. I prefer to keep my brain healthy over getting some bucks.

Brent said...

Okay, my last issue was that if you import a .NET webservice with an enum in it, and the enum begins with a capital letter, Flex just wouldn't import the enum. Lower case is fine. Way to go Flex.

Now I have some code in Away3d, and they use the new Vector "generics" in their code. Of course the first thing I did was try to use it in an SWC file, and it doesn't work. So you can use generics in a SWF application, but you can't use generics in a SWC library?

I've programmed everything from C to C# to Java, and now Flex. I do have to say, Flex is the worst, most half-arsed language I've used next to VB6.

Brent said...

Rather than debating in metaphors about hammers, let me add one more piece of actual evidence to the "Flex sucks" argument... Why can't I import a web service into an SWC file?

In a language where libraries are treated as second class citizens, its pretty hard to build a maintainable app.

Oh yeah, and whats up with the no global error handler issue, how many years have we been waiting for basic error handling?

Brent said...

Oh yeah, and BTW, why does the SWC compiler require you to specify the name of *every* class you want to include in the library? Its a library! Of course I want to include all the classes... what else would I do with them???

This makes doing an automated build a huge pain in the ass, and clearly shows that the people who wrote Flex failed to learn any lessons from mature languages like Java or .NET

Brent said...

Oh, and special thanks Adobe for making me sit through hours of "Updating links to source folders", whatever the hell that means.

Brent said...

Oh, and way to *not* use the credentials property on generated webservices to, you know, pass credentials. So there is no built in support for HTTP basic authentication? great...

Guy Ross said...

Flex is only useful if you imitate the examples.

Once you go outside the lines, trying to inherit/extend the base classes it's just a nightmare.

I've just spent a week(!) trying to create a custom itemrenderer and a custom listBase.

Sadly, it's the best tool to develop graphical interactive web content.

UGHGUGHGHGHGHGHG!!!!

turbidity said...

I'm still getting comments on this post, even several years later. I feel I should mention that my opinions have changed a bit. First off, the Flex Builder IDE, now Flash Builder has improved greatly in its stability. It still occasionally freaks out, but since I wrote this post, it's gotten much better.

I'm looking forward to better behaviors in Flex 4, especially in regards to states and binding, but in general the IDE is much better now. When I go back to pure AS3 projects, I miss having skinnable combo boxes and layout controls.

I don't care for the hijinks with silently failing errors or state deferred instantiation, but my anger has certainly subsided as the tool has improved.

xvl said...

I'm very new to Flex and I'm using Flex Builder 3, it's still very difficult to program for. Granted I only have minimal experience in programing (VB lol), Flex is vastly more difficult than VB. I think the reason why Flex sucks this bad is because Flash was not originally designed as a language that allows you to build complex applications like this. Adobe just keep adding more and more sh1t to it without consideration. Anyways, I have to learn Flex for a class, I certainly hope I won't have to deal with it again in my real work.

Dave Keen said...

AS3 itself is reasonably straighforward but the Flex framework, apart from for simple tasks, can definitely be quite complicated. But once you understand what Flex is really doing under the hood, especially with regard to databinding it all falls into place. I recommend having a read through this presentation in order to get some insight what the MXML compiler is really doing when you use [Bindable] or squiggly brackets.

Databinding has a bunch of caveats (for example the one mentioned here where error in databinding expressions don't show up), but once you know what those caveats are, and why they are there Flex is great for everything from super-quick app prototypes to fully fledged application.

Dave Keen
http://www.actionscriptdeveloper.co.uk
http://www.flextrine.com

P.S. Check out BindingManager.debugBinding if you do want to see errors in binding expressions

RichieInOz said...

On other thing I would like to point out is that ActionScript does not support multiple inheritance. I know VB (Visual Basic) get's a lot of crap as not being "a true OOP language" for this very reason.

In my experience, FLEX is great for doing basic examples. If you want to do anything complicated, it's not easy at all. You really have to stay within the boundaries and think small.

I have noticed that the easy stuff is more complicated. Like text alignment, panel layout, container positioning. Stuff like that is incredibly difficult, although it should be the easiest aspect of FLEX.

The easy stuff is the complicated stuff. If I want my linechart graph to do complicated zooming, it takes one line of code. If you want to center the text of a Spark Label, forget about it.

All the CSS hacks to make them overrides is a joke. If you make the mistake of using a FLEX theme from Adobe, forget about disabling it or over-writing it where you need to adjust the layout.

There are too many limitations in FLEX to even call it "programming". AS3 is a joke, its just buttered up Javascript. MXML is just a janky XML markup language that is very rigid. AS3 really pisses me off because it does not support multiple inheritance, therefore in my opinion, is not a true Object Oriented Language.

To sum it up, FLEX is for "script kiddies" who have never done any real programming.

Peter said...

RichieInOz, you seem to hung up on silly things like support for multiple inheritance; a commonly criticized feature of OO languages for its ability to needlessly complicate. If you are a programmer worth his salt, you should also know that the various OO concepts can be practiced in virtually any language, even procedural imperative languages like C.

rehevkor5 said...

I can commiserate. I had a lovely problem with Flex (actually it's a characteristic of Flash) where text suddenly wasn't drawing. As it turned out, there was an undocumented upper limit of 127 for the TextField.size attribute. Of course, I can easily detect when the font size needs to be over 127 and use scaleX and scaleY to adjust. It's just the fact that the limitation silently fails that bugs the hell out of me. I don't know if it's still that way or not.

Dave Keen said...

RichieInOz - multiple inheritance is certainly not a requirement of an OO language and not including it in AS3 is a purposeful language decision (whether you agree with it or not). Neither Java nor C# have it either and certainly most developers consider these to be true OO languages.

There a definitely a few things wrong with AS3 as an OO language (argument overloading, for example), but I wouldn't say that this is one of them.