Nowadays there seems to be a strong urge to replace just about any given desktop application with a web application, sometimes simply because it can be done. Many blog posts have been written about this (http://answers.google.com/answers/threadview/id/747326.html, http://www.vinnylingham.com/top-20-reasons-why-web-apps-are-superior-to-desktop-apps.html, http://community.lionhead.com/forums/thread/3269113.aspx, http://www.bin-co.com/blog/2007/08/between-web-application-and-desktop-applications/, http://www.readwriteweb.com/archives/offline_webapps_online_desktop_counterpoint.php, the list is endless), and I am not going to repeat them here. What I will do, though, is hopefully shine some light from a different angle on this debate.
Before I set out, let me say that I have written (and still carry on doing so) both types of applications. I am strong believer that before making the decision which technology to use, one should carefully weigh the advantages and the disadvantages based on the circumstances of the case.
What follows from here presumes that the reader has made the effort to read the articles linked to above.
When looking at desktop applications, I think we need to distinguish between two very different types. Type A would be the kind of software that generally tends to work on its own, although it can use networked resources to some degree. The classical here being, of course, Microsoft Office (and many others of similar ilk) or Corel Draw or even software development kits (e.g. Visual Studio,…). That’s what most people imagine when they hear “desktop software”.
Type B is the kind of application that is developed by a company to fulfill an internal need. In most cases, these applications are never sold to the outside world (they are way to specialised to be useful to other companies and/or they provide the cutting edge, so the owner would not be interested in selling them), and more often than not these applications rely heavily on networked resources available within that company. In general, these are called enterprise applications. And from experience I would say that approx. 70% of desktop software, if not more (obviously exact figures are a bit hard to come by), fall into this category. This would be true if not in terms of numbers of applications, then certainly in terms of lines of code. At one of my previous employers I was responsible for a set of desktop applications and services built from around 250.000 lines of code, and I am under the impression that this isn’t even particularly big when it comes to enterprise applications.
And then there is type C, which are commercially sold enterprise applications. Typical examples would be accounting software (e.g. the Microsoft Dynamics series) or ERM packages. Often they are big, expensive and not deployed by just installing a client o a desktop (or laptop) computer.
Why do I make that distinction? Well, because the answers to “Could or should this be done as a web application?” vary a lot depending on the type and on the circumstances of deployment.
It is often argued that one major advantage of web applications lies in the fact that they don’t have to be installed, thus avoiding heaps of costs, and the complications that stem from having several version of the software in the field. Now consider this: any software that is mostly used within a company, can easily be written such that on startup of the application it checks whether a newer version is available from a local repository and, if necessary, run an upgrade process. In theory (and with increasing internet bandwidth also in practice) the same can be done for applications available from a global repository. Which completely negates this major argument right away. It also removes the legacy argument, because by sheer virtue of the fact that on every application startup the check is performed, there can be no legacy versions in the field.
“Oh”, I can hear you say, “but then the startup time would be unbearably long!”. No, not necessarily. If your applications are structured properly only the upgraded parts need to be downloaded. And if you deploy regularly, only a few parts will be affected. And if you don’t deploy regularly, then what exactly are you doing? I think the time of deployment cycles a la Microsoft (5 years between MS Office XP and MS Office 2007) are well in the past, the FLOSS community is showing the way here with incremental releases every few months or even weeks.
So, that immediately brings this particular discussion to an end.
Then there’s the argument about platform independency. Well, I have to tell you: if you still write software that can only be deployed under one particular operating system, don’t come whingeing to me. There are a number of frameworks out there that allow deployment to multiple platforms. Use’em. Another one busted.
I could go on shooting down these individual arguments, but that’s just tiring and not proving anything, because it doesn’t answer the question. So what does?
Well, as one of the articles referenced above points out, there are a few factors that determine acceptance of any given tool (and a piece of software is just that, a tool to get a particular job done):
- availability
- responsiveness
- clarity
- utility
I would put some of my own at the end of that list, particularly when I have to make the decision on how I am going to implement a particular set of functionality:
- speed of implementation (essentially time to market)
- convenience
- purpose
Out of the first four, I think eiffel-ga has pretty much conclusively shown that only responsiveness is a real divider. And there, I have to say, desktop applications win hands down. Which is mostly due to the technology used. By its sheer nature, a web application has a problem when it comes to preserving state. The protocol doesn’t support it, so the application has to implement something to do it in its place. There are various techniques used, but they all result in a lot of extra work. AJAX seems to be the answer for most people, but hold your fire: it plays havoc with your browser behaviour. And: you need to load a lot of javascript to make this work on a scale comparable with a desktop application. And if you say, not a problem, I’ll just make sure my server roundtrips are really fast: now you depend on the quality of the link. And it is very inefficient, because on every roundtrip to the server the context or state has to be rebuilt from scratch before you get to execute the one thing you came for.
Example: in a web application showing a number of tabs as menu items, the user clicks on a tab. The page submits and reloads. If this happens in an environment requiring authentication, the user context has to be established (usually from a cookie or some hidden fields), then the effects of that usr context on the actual environment have to be computed and only then can the web application execute (or refuse to execute) the required action.
A desktop application has all of this context and state information stored in memory and has instant access to it. Only the minimum number of queries to the database is required (if there is such a thing) to provide the information needed to execute the requested action. In some desktop applications not even that, as the data is stored in cached objects. Result: blinding speed. With reliability. As I said, desktop wins hands down on responsiveness.
Now why do I add the other three vectors to my decision matrix? In fact, why do I think these are really the important ones?
Nowadays it’s time to market that more often than not ensures a win. What’s the point of releasing a competitive piece of software if the market is already taken by another company? You are having an uphill struggle all the way. What’s the point of releasing an internal enterprise application 6 months after it is needed? There is none, because the company doesn’t exist any longer. In terms of providing working solutions for a perceived or real need of your target market, speed of delivery is of the essence. Does that make a clear winner for desktop applications. No, not necessarily. If you already have a working web application environment, then it could be quicker and easier to build something on top of it. So no clear winner, it all depends on circumstances. However, if you start from scratch, then I would argue that at least at the moment desktop applications still have the nose in front, as generally web applications require a lot more framework building in order to get something properly off the ground. OTOH, this may change in years to come. I certainly have seen very good efforts in web frameworks.
Convenience is a keyword of our times. We have convenience stores everywhere, and despite the fact that most of them actually offer a lot of crap, they also offer convenient points of sale for everyday items. Convenience is king when it comes to selling on the internet. Nobody in their right mind would even think about implementing a store front for an e-commerce company as a desktop application. Why? Because it would be really inconvenient for the user having to first download the shop software before they can go an browse the catalogue. Same goes for search engines, image galleries, publishing software (such as a blog), and so on. If convenience is a major factor in the application you are going to build, the web application is a clear favourite.
And, finally, purpose. This is a bit difficult to nail down. Probably best to use some examples. If the purpose of your application is to connect people that otherwise have very little in common, the internet holds the ace. Hence the success of LinkedIn, facebook, twitter and so on. If the main purpose of your application is to allow somebody to do something on his own in his little room (i.e. its a type A applications, see above), chances are you’re better off with a desktop app (which is probably the reason why only some specific games are internet based, and most others are desktop based, think about it!). For most type B applications the web platform also doesn’t make a lot of sense unless you already have a working web framework in place. The disadvantages simply outweigh the advantages. And what about type C applications? Well, there I am pretty undecided. And, so it seems, is the world at large. MS Dynamics CRM has two clients with almost identical functionality, one as a plug-in for MS Outlook, the other is a web client. Alfresco, a serious OSS document management system, has desktop clients (Windows Explorer plug-ins) and a web interface. I think the reasoning here is simply that these heavyweights can afford the effort to build both interfaces, because their commercial raison d’etre provides the funds to do so, and it adds choice for their customers.
And so the list goes on.
So let’s come to a conclusion. The clear winner is:… … … ahem, I’m sorry. There is no clear winner. It all depends on the circumstances, the purpose, the time available for the first release, and a host of other factors.
I suppose what I really wanted to say with this article is: don’t be dogmatic, be pragmatic. Think first WHAT you are trying to achieve, then HOW. Not everything that can be done, should be done. And not everything that has been done, has been done for the right reasons. Technology changes. The environment changes. Your target audience changes. Take all factors into consideration and come to a decision based on weighing all the factors against each other, case by case.