Flex 3 vs Silverlight 3: Enterprise Development

With the recent release of Silverlight 3 and Flash 10 / Flex 4, the Flash vs Silverlight debate has been stoked yet again.  The debate has been raging on twitter using the tags #flex #silverlight.  Links to articles are posted almost every day and retweeted endlessly.

The latest two most talked about articles fall squarely on each side.   On the Silverlight front, a blog post from a coder with a lot of experience in .NET and some Flex experience shares his insights on enterprise development.  His experience with C# colors his opinion of Flex development however, and his inexperience with Flex is evident through his omission of development tools such as FDT and Flex frameworks such as Mate.  His biggest arguments revolve around language features (C# is a more robust, full featured language), AS3’s lack of a native decimal type, and the Flex IDE.  In regards to Silverlight’s penetration, the author claims that since Enterprise apps work within a company, it’s easier to get Silverlight installed.   He finishes the blog post with a nod towards Flex: “this particular Flex application is the best looking application I’ve ever seen!”

On the Flex side, Tim Anderson writes about the release of Morgan Stanley’s Matrix application in his blog.  In it he highlights a few points made during the presentation on why Flash / Flex was chosen over Silverlight.  The main points of the article highlight Flash Player 9’s penetration and Silverlight’s lack-there-of, the application’s speed, and allowing the designers on the project to use products they wanted during development.   The most insightful quote of the presentation was regarding the design tools:

“You have to look at the people that use that technology. The design community. That’s the biggest problem that Microsoft has. The designers all carry around Apple laptops, they all use the Photosuite [sic] set of software tools. It’s like asking structural engineers to stop using CAD applications. That’s the tool that they use, and if you can’t convince them to switch away from your software suite you are going to get a limited number of designers that will use Microsoft’s toolset … if you can’t get the designers to switch, to learn a new language, then how can you possibly ever get some traction?”

So there you have it, one article by a seasoned .NET developer decrying Flex’s lack of language features and another decrying Silverlight’s inability to win over designers.

I have also straddled the fence between .NET and Flex developer for a number of years and have worked a little bit with Silverlight, so I tend to agree with both articles.  They are both right.  AS3 is an inferior language and it’s default IDE is definitely no match for VS.NET, however Flex/AS3’s speed isn’t as bad as is made out and it’s a platform that is ubiquitous and has a VERY low barrier of entry for designers and other non-developers.

So this debate boils down to form vs function.  It’s harder to write a large application with a lot of business logic in Flex, however it’s easier to make it look good.  The opposite is true for Silverlight.  So just like a with any other technology, you have to make a choice based on your audience, the design, and the lifetime of the application.

So I’d recommend Silverlight if:

  • your audience is a small and you have control over the environment they are going to use the app in

  • the design isn’t complex (like heavy use of blend modes, interactive 3d elements)

  • you need tight integration with a .NET backend

  • there is a lack of Presentation Layer Developers

I’d recommend Flash if:

  • you are serving a large, diverse audience

  • you have a complex design with animation (3D, webcam integration, etc)

  • your application uses mainly webservices to communicate to a backend

  • sufficient presentation layer development resources

You can duplicate most sites built in Flex in Silverlight and vice-versa (with a few exceptions).  It’s just a matter for the right tool or the right job.  I lean towards Flex because I feel it has the most flexibility (no pun intended), but I do like XAML / WPF / Silverlight and am excited to see it evolve and be a competitor to Adobe.

Everyone wins when there is competition.

Taming IE6 and a "Drop IE6" rebuke

During the development of any project that involves HTML, there’s always a nagging question in the back of your mind:  “How broken will this site be in IE6?“  Here’s an article that will reduce the amount of worrying you do when fixing your site to work in IE6.  It covers the majority of issues you’ll encounter when working with IE6.

Definitive Guide to Taming the IE6 Beast

The article covers:

  • conditional comments

  • target IE6 CSS Hacks

  • Transparent PNG-fix

  • double margin on float

  • clearing floats

  • fixing the box model

  • min/max-width/height

  • overflow issues

  • magic-list-items appearing

It’s probably the last article on IE6 specific CSS techniques you’ll ever need to read.  Required reading for all PLD’s.

On the topic of IE6 and whether or not we should still be supporting it, here are some thoughts.

IE6 support seems to be waning, but we still have plenty of clients that are still running IE6 exclusively on their work machines, so until they upgrade to Windows Vista / 7 we’ll continue to have to support them.

In the past year there have been a few campaigns to get people to upgrade like hey-IT.com, www.bringdownie6.com, and www.end6.org.   Also, Google just announced that YouTube wouldn’t support IE6 anymore in the near future.

Sadly, the more I thought about just saying “no more IE6 support”, the more I realized that the people that were running IE6 at this point couldn’t upgrade.  They are usually either on older machines (Windows 2000 or earlier) or their IT won’t upgrade because of a legacy web-based application depends on it, like a CRM or ERP app.    These applications aren’t upgraded often, and they are definitely not upgraded during a recession.

Full IE6 support is vital for any site that caters to business users (IT issues / older computers), international users (older computers), or a large percentage of the public (lots of people don’t upgrade their computers/OS when all they do is browse the web with them).

Here’s a good chart that shows the trends for various browsers / versions from Oct-04 to May-09 based on data from NetApplications.com

It shows IE6 usage just below Firefox usage in May-09.

As much as I dislike “fixing” the sites I work on to work with IE6, I think we’re going to have to do it at an agency level for another year or so.

Collaboration and Enterprise 2.0

AIIM (www.aiim.org) non-profit organization for enterprise content management (ECM) has released a report on how “Collaboration and Enterprise 2.0” is gaining importance among business.

According to this AIIM report, there has been a dramatic increase in the understanding of how Web 2.0 technologies such as wikis, blogs, forums, and social networks can be used to improve business collaboration and knowledge sharing, with over half of organizations now considering Enterprise 2.0 to be “important” or “very important” to their business goals and success. Business take up of Enterprise 2.0 has doubled in the last year. ** Here are some key findings:**

  • Knowledge-sharing, collaboration and responsiveness are considered the biggest drivers.

  • Lack of understanding, corporate culture and cost are the biggest impediments.

  • 71% agree that it’s easier to locate “knowledge” on the Web than it is to find it on internal systems.

  • 40% feel it is important to have Enterprise 2.0 facilities within their ECM suite, with SharePoint Team Sites as the most likely collaboration platform.

  • Only 29% of organizations are extending their collaboration tools and project sites beyond the firewall.

  • As regards governance of usage and content, only 30% of companies have policies on blogs, forums and social networks, compared to 88% who have policies for email.

  • Whereas almost all companies would not dream of sending out un-approved press releases or web pages, less than 1 in 5 have any sign-off procedures for blogs, forums and even the company’s Wikipedia entry.

  • Planned spending on Enterprise 2.0 projects in the next 12 months is up in all product areas.

About 47% companies opted for SharePoint as a collaboration platform

SharePoint as a Collaboration platform

SharePoint is leading the Enterprise 2.0 revolution by providing a comprehensive business productivity platform that combines traditional collaboration solutions with newer social-computing technologies in an enterprise-capable product. Using rich blog, wiki, RSS, mashup and social-networking solutions combined with the enterprise content management and search capabilities of SharePoint, SharePoint customers are well positioned to deliver real Enterprise 2.0 solutions today.

Companies can use social tool plug-ins like Socialtext, Atlassian Confluence, and Connectbeam (among with many others) to add more advanced SharePoint social features.

More information about SharePoint Server social-computing is available on Microsoft’s website

You can read more SharePoint articles and how-to’s on my SharePoint blog.

SXSW to Go: Creating Razorfish’s iPhone Guide to Austin (Part 3)

Optimization

As the Razorfish Guide to SXSW became more fully developed, we started to look at key areas where we could make performance gains and either actually speed up the site or simply make the site appear to load more quickly. (Check out part 1 of our story to see how requirements for the site were gathered and part 2 to learn about how the site was architected)

Cache it good

One of the earliest steps we took to optimize the application was to use server-side caching. ASP.NET allows you to cache just about anything on the server for quick retrieval. Taking advantage of this feature means that you can avoid extra trips to the database, requests to other services, and repeating other slow or resource-intensive operations. The Razorfish.Web library’s abstraction makes ASP.NET’s caching easy to use, and we quickly added it both to all database calls and to store most MVC models.

Zip it up

A second key optimization was to add GZIP compression to our assets. GZIP compression shrinks the size of most text-based files (like HTML or JSON) down to almost nothing, and makes a huge difference in the amount of time it takes for a slow mobile client to download a response. IIS7 has this feature built in, but we were running the site off of an IIS6 server. Happily, Razorfish.Web.Mvc has an action filter included that supports compressing your responses with GZIP.

Strip out that whitespace

Next, we used Razorfish.Web’s dynamic JavaScript and CSS compression to strip out unnecessary characters and to compact things like variable names. Minifying your scripts and stylesheets reduces their file size dramatically. One of the nice features of Razorfish.Web is that it also can combine multiple files together, reducing the overall number of requests that a client has to make. All of this happens dynamically, so you’re free to work on your files in uncompressed form, and you don’t have to worry about going out of your way to compact and combine files.

Sprites

Another key optimization was combing all of the image assets into a single file, and using CSS background positioning to choose what image to display. Doing this not only cuts the number of requests that have to be made (from 10 to 1, in our case), but also cuts the overall amount of data that needs to be loaded. Each file has its own overhead, and you can cut that overhead by combining them.

Keep it in-line

As we started testing on the actual iPhone, we still weren’t satisfied with the page’s load time. There was a significant delay between the page loading and the scripts loading over the slow EDGE network. This defeated the purpose of the JSON navigation because the user was apt to click a link before the scripts had a chance to load and execute – meaning that they’d have to load a new HTML page. If the scripts were delivered in-line with the page, there would be no additional request, and they could execute right away. Because the successive content was to be loaded with JSON, concerns about caching the scripts and styles separately from the page were moot. We set about extending Razorfish.Web so that it could now insert the combined and compressed contents of script and style files directly into the page. By moving the scripts and styles in-line, we shaved off about 50% of our load time, and the scripts were now executing quickly enough that the JSON navigation mattered again.

Smoke and mirrors

A final touch was to take advantage of Safari Mobile’s CSS animation capabilities. The iPhone supports hardware-accelerated CSS transitions and animations, meaning fast and reliable animation for your pages. We added a yellow-glow effect to buttons when pressed. The glow was not only visually appealing, but its gradual appearance also helped to distract the user for the duration of the load time of the successive content.

Success

The team managed to pull the web application together in time for launch, and the guide was a smashing success. Over the course of SXSW, sxsw.razorfish.com was visited by 2,806 people who spent an average of 10 minutes each on the site, typically viewed about 8 pages, and often came back for second and third visits. The site attracted a large amount of buzz on Twitter and was praised as the go-to guide for the conference.

When designing for mobile, speed is key. All of the components of the site, including the design, need to work together to connect the user to the content as quickly and as efficiently as possible. In such a hyper-focused environment, the user experience, graphic design, and technology need to be unified in supporting a shared goal.

By producing a responsive, reliable, easy-to-use, to-the-point, and locally-flavored guide to the city, the team succeeded in creating a memorable and positive impression of Razorfish at SXSW.