The Modern Web: One Platform to Rule Them All

The Modern Web: One Platform to Rule Them All

In the last few years, the rate at which new standards such as HTML5 and CSS3 are being improved and implemented has increased significantly. After years of stagnancy with HTML4, browsers are once again rushing to embrace the latest standards in order to remain competitive.

One of the more interesting things about the latest iteration of HTML is that it intends to make the whole process of rendering a web page fool proof. One of the big issued of the previous generation of standards has been the way browsers handle pages that are non-standards-compliant, and how that differs across different browsers. This necessitated the use of tricks and per-browser code that made web development hell. HTML5 does away with all that by defining the rules for rendering such erroneous pages a part of the standard. So with new generation standards, one can expect the same rendered output across all browsers across all platforms –if the browser itself is standards compliant of course!

Status Quo

If you feel that mobile devices lack when it comes to standards support, know that this is not the case. Most mobile OSs today ship with a modern browser that supports the latest web standards. In fact browser statistics reveal that mobile devices are better prepared for newer standards. All major smartphone platforms, iOS, Android, BlackBerry, MeeGo, webOS, and bada include browsers with good support for emerging standards. The only platform lagging in support is Windows Phone; hopefully not for long.

It is safe to assume that the device capable of running your application also have a standards-compliant browser. More so on mobile platforms than on desktops actually.

Another important fact to consider is that unlike desktop platforms, mobile OSs offer a limited set of APIs that restrict access to the device. The web offers an even more restricted set. However if you can create the same experience using web APIs as the device APIs might as well stick to the web!

The web is also incredibly open, and that is something to embrace. The Apple store (or any other store) could block your application based on their arbitrary rules, but they cannot block your web applications without crippling the device’s browser.

A number of platforms are now embracing the web standards as a means to create applications. MeeGo’s successor Tizen is an HTML5 based platform, webOS entirely allows web applications, iOS allows pinning web apps as normal apps, and Android too can have bookmarks on the home screen.

The Web’s Expanding Scope

You may wonder though, can you really make a full-fledged application that runs in the browser?

Any programming language will offer you a syntax for describing logic, along with a standard library that exposes some basic system functionality. C and C are preferred over other languages when it comes to system programming as they offer unprecedented control over the native hardware. Although for most tasks it is easier to implement working code in many other languages. hile JavaScript makes is incredibly simple to add some logic to web pages, it didn’t offer a whole lot else. This was for a good reason of course, but it also limited what was possible inside a browser.

Of course this wasn’t the only barrier. Imagine something like Wikipedia at a time when the internet was still new, slow, and expensive. How convenient would it have been for people to access and edit an encyclopaedia over a faltering dial-up connection, while paying large sums of money for the privilege? No, at that time even something as simple as a mostly text-based encyclopaedia might have seemed unsuitable for the web.

The internet has now reached more people, it has become ubiquitous, cheap, and fast, and the Wikipedia model is thriving. Some now look at the increasing prevalence of web applications with disdain, because apps don’t fit the browser paradigm, but that is changing.

Today it seems odd to use a native email client when it can all be done in a browser. Even though WebMail has all the failings of a website, it is slower than a native client, it is not accessible offline, and it isn’t as well integrated with your system. These disadvantages are fast disappearing though. As more people store their photos and documents online, it is only a matter of time when editing them online will feel as natural.

Gaining Parity

New features available with recent standards

While HTML5 has been used as an umbrella term for just about anything under the sun, its actual scope is very limited, and is mostly about the markup. The whole range of new web standards however allow for great new features, some of which are listed below:

  • Rich expressive animations and graphics using the canvas
  • JavaScript-free animations and transitions with CSS3
  • Manipulate graphics using the canvas
  • 3D rendered content with the canvas 3D context
  • Video and audio without plugins
  • User location via geolocation APIs
  • Local data storage using LocalStorage
  • Local databases via the IndexedDB API
  • Reading and writing local files using the File APIs
  • Push notifications from servers via Server-Sent Events
  • Efficient, powerful network communication with WebSockets API
  • Intra-document messaging with the Web Messaging APIs
  • Asynchronous processing of data using WebWorkers
  • Manipulate the browser history using the History API
  • Richer forms
  • Drag and drop files from / to desktop
  • Notifications, access to webcam and mic etc. (not well supported yet)

Not all of these features are available yet, however work is in progress to include them in almost all browsers. A large number of them can be used today across all platforms and major browsers.

Imagine an online image editor created a decade ago. Such an “application” would not have been able to read a local image, or manipulate it in the local browser. At most the user could select an image, upload it to the server, specify some operations to perform, and get back an edited image to download. Also such an “application” would not work offline, and would be terribly slow if your images were even a few MB. It is obvious why no one would use such an app.

Now look at how things stand today. The new File APIs will allow a web app to open and edit local files, and the Canvas API allows one to manipulate graphics making it possible to edit images in the browser itself. This is also helped by the fact that JavaScript is fast enough to do this in the browser now. Using new specifications for offline applications, a web app can be designed to work even when there is no connectivity. Other than the fact that it is running in the browser, this is quite similar to any native application.

It is unlikely that web based applications will ever reach the same parity in performance or features as native applications, however they can offer a different set of advantages that can weigh the scales in their favour. Web applications are easier to develop and update, and all your users run the latest version.There is no need to install the software, or uninstall it, just open the site and it works.

The web as a platform is becoming increasingly powerful as new standards continue to be proposed based on actual needs of developers. You can see a list of some of the things that you can achieve using new web standards in the sidebar.

Native advantage?

Is there really an advantage to go native now? Sure performance is a concern if your application requires heavy processing. Or is it? Consider YouTube, each uploaded video is converted to a plethora of formats that are to run on all manner of devices. Many YouTube users are uploading from devices that aren’t even powerful enough to encode video, so YouTube does it for them. Another example is Autodesk Homestyler that lets you model houses in 3D in your browser; these can then be rendered in high quality by Autodesk servers so they can be viewed even by users having systems too slow to do the rendering. As you can see, in these cases, the performance of a web application can be significantly more than that of a local app. You will find that most disadvantages have a counter advantage.

We have now grown used to the concept of offline apps, or apps that don’t need an internet connection to work. However even native applications are increasingly becoming internet aware, and thus internet dependent. Whether it is for activation or updates, or even for downloading the application in the first place! Internet is becoming a requirement.

Today an average user will browser the internet for an application that fits their need, download it, install it, and finally run it. If it costs, then you have to pay for it and probably activate it as well. This process may need to be repeated for each update or upgrade.

Now compare this to a web application. You browse the web for an app that matches your needs, you open the app, and it just works! If you need to create an account, that is an added one time process, and payments are usually recurrent with no need to pay for upgrades. It is actually more convenient to open the website since downloading and “installing” the software isn’t required. Add to this the fact that you can do this whether you are running Windows, Linux, Mac OSX, iOS, Android, BlackBerry or any esoteric OS running on any esoteric device as long as it supports a web standard capable browser, you don’t need to pay again for a license. In the end, the process of using a web application is also one of downloading (your browser does this, and if supported it caches it), “installing” (or creating a bookmark), and then launching (via the bookmark or URL).

Today if you are looking to create an application that will reach mobile, tablets, desktops, and perhaps even TVs, there is one “runtime” / platform you could consider developing for; and that is your browser.

Digit.in
Logo
Digit.in
Logo