July 5, 2020

Consider a Web Application for Your Next Project

Consider a Web Application for Your Next Project

Web Applications

Considered by proponents of the web to be one of the next big shifts in software development, web applications are normal everyday software programs and tools that run directly in a web browser; no additional software needed. This big shift has been foretold for many years, and while the advent of HTML5 gave it a huge boost, the mega shift still has not occurred. Still it appears that the shift is ultimately inevitable as Internet availability and use increase worldwide, and web browsers become more and more capable. Large companies like Microsoft have been offering web versions of their products for years, and frameworks such as Apache Cordova enable web applications to be converted into native apps for mobile devices.

Technologies

Web applications rely on a variety of technologies, but the core is the trio of HTML, CSS, and Javascript. If you're not familiar with any of those, where have you been living the last 15 years?! If you're not a software developer then I guess you're forgiven, but the rest of the article might not be your jam.

Benefits

Of all the reasons to pick a web application for your next project, near universal compatibility must rank near the top. Build your product/application once only, and your product is usable by all of your users, regardless of their device and/or platform. One code base instead of one for this platform, one for that, and another few for them, means lower maintenance and development costs in time and money; it also means faster time to market for the product, and new features.

Easy distribution. Not only is your application compatible with everyone, but it's even easier to deploy. All a user has to do is visit your site, and that's it! The user's web browser downloads the needed files automatically like it does for any web page, and away they go. Files can be set to download at certain times to make it appear to the user like everything is ready, thus not holding them up while everything downloads.

Easy deployment and updates. No more compiling needed; all code files are just text files. Just upload the files to a web server and you're done! You may want to minify and/or obfuscate the files first, but it's not required. Updates are just as easy; just upload and you're done. You may have to do some careful cache navigation to ensure the browser bothers to check for your updates, but often it's optional and just as simple as it sounds.

Choice of technology for your product is important for many reasons, but some often overlooked criteria are the availability of skilled developers, and the development tools to do the work. Web languages (html, css, javascript) are all free to use, and the tools are also free and well supported; all the major web browsers are equipped with powerful debugging and diagnostic tools by default. Free and well developed and distributed languages and tools, means large numbers of developers who are knowledgeable and skilled.

Drawbacks

Performance is the most obvious and well-known limitation of web applications. There are many layers in between your code and the code the CPU understands, and each layer comes with its own overhead. While there was once a significant gap between native and web applications, browser vendors have made tremendous leaps forward towards closing that gap. While 'on-par' performance is still out of reach, the gap closes more each year and may not be there forever.

Multitasking is another issue. Javascript by default is single threaded, meaning any processing blocks all other processing. There is the ability to spawn child threads in Javascript by way of workers, but it is not as common a skill among developers.

Hardware optimization and access. Web applications live in the tightly controlled silo of the web browser. Unlike native applications, there is little to no hardware control beyond your microphone and camera. You can forget about reading from a folder, or interfacing with a GPU. The browser is shut tighter than a communist state. This is largely for the purpose of protecting your users however, which is never a bad thing.

What About if Your User is Offline?

Naturally the biggest drawback of all to web applications, is the unavailability of the application when the user does not have an Internet connection. Despite what many out there might say, there are still a great many places and situations where there is no Internet, or the connection is unreliable; there's a reason cell companies bring in portable towers for large gatherings and festivals. If you're going to build a web based application, it needs to work for the user when they don't have a connection to the Internet.

Fortunately there are browser features available that enable applications to function 100% without an Internet connection (after downloaded), and anyone who says otherwise is about to get learned.

If you think I'm about to suggest Application Cache (AppCache), guess again. AppCache was a first attempt at a system for managing web application files, and enabled files to be stored and the application to run in the browser without the need for an Internet connection. It was a bit clunky but it worked. The real downfall of AppCache was that it couldn't properly be managed via javascript, so now while it may still be supported in some browsers, it is considered deprecated and should no longer be used. AppCache is out because it was replaced with something 'progressive', which addressed its limitations.

Progressive Web Apps and Service Workers

"Progressive Web Application" is a long and fancy sounding name for a web app that employs a Service Worker, and as such is capable of running in a browser with no Internet connection. Service Workers are the replacement for AppCache, and are extremely powerful and flexible. With Service Workers, a developer has complete control over what files are needed to run while offline, when to download and/or upgrade them, and what to do if there is no Internet connection. The best part is that a Service Worker runs in a separate thread to your web application, and they don't even have to talk to each other. Your application can function as if there is no worker, and the worker takes care of all the connection details without troubling or holding up the application.

If Service Workers sound too tough or time consuming to develop, do not despair. Check out our Service Worker project GitHub page for a ready-made worker (who works for free!). It takes care of all the offline handling and automated updates for you, so that you just need to focus on building your app.

Ahead of Their Time?

When the iPhone was originally introduced, it was announced that it would only run web applications. Apple later had to walk back from this as the underlying technology simple wasn't capable at the time, and developers were not as ready to accept a web approach as they are now.

Mozilla made a lot of noise a few years back when it announced Firefox OS, an operating system for mobile devices designed specifically to run only web applications. During development they were able to demonstrate at par or better performance of web apps vs native apps on identical hardware. Sadly the project suffered from a series of management missteps and other bureaucratic obstacles, and never became commercially viable before it was abandoned.

When is the Time?

It's easy to imagine that it's only a matter of time until the web platform becomes the standard for any application with a human interface; even if that's wrong, there's still plenty of good reasons to build your next project as a Web Application. Google's ChromeOS for Chromebooks is highly popular, powerful, and almost fully web-based. Microsoft has also thrown its weight behind the technology with web versions of its Office/365 product line.

A technology that is fully cross-platform by default and supported everywhere, just makes sense. It seems likely that the web app will dominate eventually, but will you be ready?