At A Glance Main Projects Tutorials Resume

Contact


Email: palen1c at gmail.com




Developing Interactive Experiences In Windows Presentation Foundation Vs Adobe Flash Air and Flex

Mon, 13 Aug 2012 14:32:42 EST

I'm now fortunate enough to be going into my fifth year working in the museum industry. During these five years I've developed several touchscreen experiences, many which incorporate unusual but always fun components. The chief programming language used for the user interface of many of those experiences has been Actionscript 3 on the Adobe Flash, AIR, and Flex platforms. Over the course of my professional career, I've also gained commercial experience in PHP, Java, Perl, Javascript, C++, C, SQL, several DBMS SQL variants and .NET Technologies. In the most recent experience, I had the pleasure of using Windows Presentation Foundation.

Before explaining the intricacy of both programming experiences, I need to explain the acronyms and meanings involved.

All Adobe AIR and Flex do for the most part are add capability and classes to the core Adobe Flash platform. Due to the teams I have worked with, I have used a mix of Adobe Flash CS3, CS4, CS5.5, Flash Builder, Flash Develop, and the Flex SDK. Flex is similar to html and xml layout language that helps programmers and tools to quickly layout user interfaces.

On my latest exhibit, the Maker Faire Mosaic; I used the Microsoft Kinect and had to learn Windows Presentation Foundation to a severe degree in order to pull off the level of work needed for a professional exhibit. I had used C# many times in the past, and it is my favorite .Net language for Windows Forms applications, so C# was used in the mosaic as well. I used C# 2010 express during my Windows Presentation Foundation work.

Lets get on to the meat of the subject. I will compare the two technologies on five key points. I recognize this may be a touchy subject so if commentator’s would like me to expand on other areas I will. So here are the four sections:

  1. Graphical Layout Capability
  2. Programming Experience For the Developer
  3. Learning Curve
  4. Programming Language Stability
  5. Company Stability

Graphical Layout Capability

Flash CS/Flash Builder/Flex

Graphical layout in flash. That complex UI element is ready to be programmed.
The Flash CS IDE is a superior layout and animation platform in my experience. The availability of doing keyframe based animations can be a little tricky at first but it is a viable option for users that do not have much programming experience.

The import of graphical assets and layout of them are very straightforward. Dragging assets into the library of the IDE couldn't be easier. Positioning those items within movie clips, buttons, or other items in the Flash IDE is also a piece of cake. Exact layouts can be obtained pretty quickly. The fact that measurements are based on every persons familiar unit, the pixel helps layout considerably. Features available in the IDE such as filters, gradients, text layout, and some blend modes are invaluable in speeding up projects.

Windows Presentation Foundation

Graphical layout in the visual studio IDE in WPF.
Layout in the Windows Presentation Foundation is very similar to laying out html pages. Many developers learn the concepts of xml and html early in their career so I consider this feature a valuable component.

Layout follows a technology known as mxml and it also has a strong understanding of resolutions and layouts for multiple screens and resolutions. However the concepts of pixel independent units that WPF preaches make it difficult for developers coming from a pixel dependent traditional environment confusing. Realistic layout in WPF depends strongly upon alignment of things in specific controls to pull off a professional user interface. This isn't a paradigm I believe any developer used to traditional technology would be able to quickly pick up and run with unless they had guidance.

Importing assets into Windows Presentation Foundation.
Many people using WPF seem to use the Expression Blend tool for layout. I personally found the graphic layout tool in C# Express 2010 to be very helpful and usable for layout.

The aspect of importing custom graphics and media into WPF applications is much less straightforward than using the Adobe tools. In the Solution Explorer in the Properties folder you have to use the Resources.resx designer to import assets which basically copies them relative to the project. Then you have to set the type of resouce the media asset is. This determines if its compiled in the exe, copied into a folder along side it, or a host of other options. The Maker Faire Mosaic did not incorporate troves of custom graphics so I am not sure if the infrastructure will buckle under lots of assets.

Programming Experience For The Developer

Flash CS/Flash Builder/Flex

Flash builder debugging is not that bad once you get the hang of it.
The neat thing about the Flash platform are that there are so many ways to develop Flash applications. For beginners or users that only have a small amount of programming experience this diversity can be helpful. This diversity can also be ridiculous. People trying to learn the Flash platform can meet difficult odds knowing where to start. For professional developers I believe all the development tools that I have used up to Flash CS5.5 and Flash Builder are frustrating. I get the feeling when using them that Adobe doesn't care about me as a developer. A great example is that Flash CS3 to 5 have serious issues with PNG sequences. The flash CS5 fla file format is a piece of trash that intermittently breaks once projects become full of assets. The Flash CS5.5 fla file format was re-done and comes with super annoying prompts to force the developer to save projects in CS5.5 file format. This sure is great when working with developers or older projects in CS4; NOT.

The terrible CS5.5 evil terrible compatibility and upgrade prompt.
On a positive note, once you know how to leverage the Flash IDE to quickly layout interfaces and cut outs of graphics, it can be a powerful tool for putting graphics shells together without needing to hand program everything. However, the code layout and script tools inside the Flash IDE are complete junk. They offer little code completion, syntax checking, and help with classes.

In terms of Flash Builder, that's a neat tool, but it frustrates me that it's just an add on for Eclipse. I've programmed a few projects using Flash Builder 4.5 but have had to use Flash Builder and CS5.5 in combination due to bugs in the compilation of only classes that have been changed. Compilation of classes that have only been changed saves compilation time, but is junk if it doesn't re-compile everything you've changed. Experiences on a recent project have also offered a few runtime bugs while debugging in Flash Builder.

The feature of the CS5.5 suite to be able to cross compile to IOS, Android, and other mobile platforms is a wonderful feature for developers fluent in Actionscript 3. I commend Adobe for the addition of this feature.

I have less experience with Flex, but the html style layout of Flex has a very similar feel to Windows Presentation Foundation mxml. I started learning the Flash echosystem using the Flex SDK and Flash Develop. I think Flex has a great place for developers that are doing application that can make use of the many pre-built Flex controls; but I don't have enough experience with it to understand how it can be leveraged in ultra custom applications like I deal with on a daily basis.

Windows Presentation Foundation

Code completion in wpf.
Programming experience in Windows Presentation foundation is very nice. The auto-completion features of the programming interface are very intuitive. The graphical layout in C# 2010 is tightly coupled with the code development features.

Blatantly put, Windows Presentation Foundation is meant for cerebral developers. The C# 2010 Express environment is a developer tool that is not friendly to people without development experience. As a developer I personally prefer the C# 2010 Express and Visual Studio environments to the Adobe environments. Visual Studio feels like it's an application that actually gives a darn about the developers using it. Sure Visual Studio and the many variants of it have their own bugs, but they make debugging applications much faster than the comparable Adobe tools.

Learning Curve

Flash CS/Flash Builder/Flex

The diversity of the Flash ecosystem no doubt generates some confusion. There are several tools around to generate the same end results. However I really believe that the Flash ecosystem has a shorter learning curve than the Windows Presentation Foundation environment. The ability of the CS suite of tools to create elaborate UI experiences without much programming offers an unprecedented experience for newer programmers.

When doing a serious project, it becomes quickly obvious that more advanced programming is needed outside the time line environment to get real work done. However the classes used in everything except the Flex environment do not differ across the Adobe and open source development tools for Flash.

Adobe seems to be ever trying to create other tools to accelerate and automate the entry into the Flash ecosystem, but they are quick to drop them when sales results don't agree.

Windows Presentation Foundation

The .Net forms architecture was a decently easy architecture to learn, but Windows Presentation foundation is a monster. Its the most complicated architecture I have had to learn in my life. That said, after learning it, I am glad I spent the time to do it.

As someone who is lucky enough to be able to work in hardcore back end programming and also elegant front end programming; to do any decent front end work in Windows Presentation Foundation it requires an 80% or more understanding of all the layout capability of Windows Presentation Foundation. The pixel independent layout complicates things as well. Personally I had to re-layout my first exhibit twice in order to properly adjust itself for different full screen resolutions. Despite exuberant claims of automatic layout, I had to add code assist to help out layout on every main display class in the mosaic.

Programming Language Stability

Flash CS/Flash Builder/Flex

The Flash and Adobe AIR run-times are without a doubt the most unstable run-time environments I have ever worked with. Memory leaks occur in the Flash environment as often as people need to eat. Probably one of the causes of this easily unstable environment has to do with the variety of development strategies available to developers and flexibility of the Actionscript 3 language.

Tools available to experienced developers really don't help. Except for Flash Builder, which has been abandoned in the CS6 suite the rest of the Adobe tools offer terrible debugging tools. I have used Flash Develop for many years, but often use it in tandem with the Adobe tools. Flash develop does have an alright debugging environment.

Windows Presentation Foundation/.NET Environment

The Windows Presentation Foundation backed by the .NET phalnax is a powerful onslaught of technology. The truth behind WPF is that most of the documentation leans toward c#, c++, and a tiny bit of Visual Basic. This worked well in my favor because I love C#, but probably alienates many long time Windows developers.

One exhibit makes it difficult to guage the full extent of a languages stability. However I know that on the day of launch of the Mosaic, it didn't suffer from leaks or instability despite the slow feel through I had to do with several of the more advanced aspects of C# and WPF. A few days prior to launch of the mosaic, during testing I did discover a memory leak. However I was able to use the freely available CLR memory profiler tool within a few hours to determine the root causes of the issue. Despite the CLR name, the profiler is not a pure command line tool.

After my own experience with the Kinect hardware, its associated API, Windows Presentation Foundation, and the C# language in 2012 I believe it is more stable than Flash even when dealing with complex topics like threads.

Company Stability

Flash CS/Flash Builder/Flex

In late 2011 Adobe made a series of announcements concerning the Flash platform that caused a, nuclear disaster for several developers in the echosystem. They announced the turnover of Flex to the Apache Software Foundation. The Apache foundation is one of the most respected software stewards in the world today, but this action caused a lot of instability in the echosystem. This didn't personally affect me due to the fact that I work across so many technologies, but I know it dealt a great blow to many others relying on the technology in their day jobs.

Every year I have watched Adobe release a series of nonsense tools in their CS bundles and every next year I have watched them discontinue a series of those tools that have been under-preforming. Examine Flash Builder or Catalyst for example. Customers introduced to the CS6 suite would never know what those tools were. Honestly it is smart business sense, but not an echosystem that developers can rely to take a hit for a few years while protecting an echosystem.

As a developer in the Adobe environment I really feel extorted. After jumping the WPF bridge I personally will attempt to avoid using the Flash ecosystem for anything I can in the future.

Windows Presentation Foundation/.NET Environment

The Windows echosystem is notorious in the technology echosystem for holding out on discontinuing support for technologies across several years. I truly hope that commitment won't change with Windows 8 on the horizon. Even an internal Microsoft developer in the Terminal Services group I went to school with mentions that he has been developing in Javascript for the past several months. That makes me really nervous concerning .NET technologies. Strategically I realize the push toward more open development technologies. Just not sure how that combines with the traditional .NET API's.

In any case, I was able to leverage my knowledge of C# fully in WPF development without much hindrance. I was also able to leverage this knowledge using freely available tools. Knowing that with a knowledge of WPF allows me to develop Windows Phone, Windows Surface, Kinect, and traditional Windows applications. I really feel that the four month learning curve was not a waste. I know that the new Surface technologies will incorporate WPF, and am also confident that Microsoft will not so easily abandon developers like Adobe routinely does.

In Summary

You may allege.."This guy is a Microsoft lover". Windows 8 terrifies me in terms of deploying it for museum experiences. Windows 7 and Vista wasted a lot of my time in that arena as well. However; I have been developing Adobe based applications for the last several years and it has been a HUGE pain in my rear! I need help developing applications, not a company that will extort me at every turn when using their technology. I have wasted a lot of time dealing with versions of Windows but even more time dealing with Adobe programming technology.

Both environments are really just tools to get to the same ends. Depending on the project requirements there are valuable use cases I can think of for both technologies.

Charles Palen has been involved in the technology sector for several years. His formal education focused on Enterprise Database Administration. He currently works as the principal software architect and manager at Transcending Digital where he can be hired for your next contract project. Charles is a full stack developer who has been on the front lines of small business and enterprise for over 10 years. Charles current expertise covers the areas of .NET, Java, PHP, Node.js, Javascript, HTML, and CSS. Charles created Technogumbo in 2008 as a way to share lessons learned while making original products.

Comments

No one has posted any comments yet, be the first

Comments are currently disabled.


Techno Gumbo RSS Feed

Related Links