Computerworld

10 reasons the browser is becoming the universal OS

A bazillion years ago in Internet time (aka 1995), Brendan Eich, Marc Andreessen, and the rest of Netscape looked at the World Wide Web and saw a sparsely tagged world of static documents -- a computational desert where a programmer's seed could find no purchase.

A bazillion years ago in Internet time (aka 1995), Brendan Eich, Marc Andreessen, and the rest of Netscape looked at the World Wide Web and saw a sparsely tagged world of static documents -- a computational desert where a programmer's seed could find no purchase.

They had a different vision: pixels inside the browser rectangle as alive as any user interface. They wanted to add a bit of Turing-complete computability so that programmers could make the pages jump. JavaScript was the answer.

In the beginning, macho C programmers gazed at their creation and laughed. They joked about JavaScript as a toy for elementary-school kids to pop up alert boxes. Eich, however, saw a way for programmers to pull in information from throughout the Web. Soon it came in the form of XMLHttpRequest.

Thirteen years later, and about eight years since the whole game was rebranded "AJAX," the once baby language for kiddies is fast becoming the dominant language for just about everything. The combination of HTML, CSS and JavaScript powers servers, desktops, and laptops. It is, in essence, the standard platform, the new operating system.

Technically, the browser doesn't offer what we've come to expect from the traditional OS. Purists will complain: Does the browser team spend any time worrying about the gnarly tangle of device drivers? Does the browser keep the file system clean and uncorrupted? Does the browser juggle multiple threads of differing priorities and help them share the same processor cores in a way that might be considered fair? The OS guys take one look at Chrome and laugh because that browser just punts, splitting itself into a different process for every Web page, letting the OS layer do the work.

Despite these very legitimate plaints from OS geniuses, the browser is the dominant layer, the one nexus for software, the one switchboard where all power lies. It needs from the operating system a rectangle to draw the Web page, a bit of storage space, and a TCP/IP feed. It does everything else in a cross-platform way that is, when all is considered, relatively free of bugs and other issues.

In return, the browser relieves the OS of doing much except supplying those few information feeds. A PC user expects to be able to insert any old device and have it work with any old collection of devices -- a very rare occurrence. A browser user wants a box to type a URL and a way to send clicks to the JavaScript layer. Building a browser-only device is getting ever easier. Heck, Mozilla, a very small group of people, turned out Firefox OS with a tiny fraction of the engineers working at Apple, Google, or BlackBerry.

And the programmers are following users to the browser to deliver functionality in the main place users expect to find it these days. Here are 10 reasons why the browser is now king.

Browser as ultimate OS reason No. 1: The rise of vast, rich Web applications

Somewhere along the line, the Web page turned into a full application. The best way to feel this is to try to start up something like Gmail with a clean cache and a painfully slow Internet connection. The program is large enough that it takes too long to download all of the bits and pieces of JavaScript. There may be close to 100 files in the average download. Google thoughtfully recognizes that Gmail may be a bit too big for these occasions, so it offers a basic HTML version that is much smaller.

Gmail is one example of the thousands of large programs that regularly run in our browsers. Many let us do the lion's share of tasks once left to native applications. There are integrated development environments (Codio, Cloud 9, and more), image editing packages (AIE, among others), and plenty of HTML5 games (see below). The browser is not limited to static documents and filling out forms.

A long time ago, people would point to the standard apps for reading mail or editing photos and say, "Can your browser do that?" Now the answer is yes.

Browser as ultimate OS reason No. 2: Easy extensibility via plug-ins

All the major browsers have their own plug-in architecture. If you want to do something clever with the browser, the plug-in layer is ready to take your code. You write some code in JavaScript and the browser adds it as a feature. You can add new routines for cleaning up the layout or snarf certain valuable information like citations for your paper. The plug-in layer for the browsers opens up the insides to fiddling, and it does so in a cleaner, safer way than can be accomplished with traditional operating systems.

Browser as ultimate OS reason No. 3: Its open source foundation

There are many different meanings loaded into the phrase "open source," and the browser illustrates one of the most influential. The Web's languages have always been easy to understand -- at least compared to native binary codes -- and when the early developers included the "view source" option, they made it easy for programmers to learn from each other.

Openness encourages innovation, and this is one of the biggest reasons we've seen the browser layer swell with so many clever additions. Building software for the browser layer is easier, encouraging more work to be done there. The pace of innovation is blinding because good ideas are emulated and improved quickly. Everyone can learn from everyone else's work, then teach everyone in return. This feature alone has created so many programmers that it should be considered a national treasure by those committees in Washington who are always campaigning to create more STEM students.

Browser as ultimate OS reason No. 4: Metaprogramming

Openness doesn't just mean the source code is available for others to copy, revise, and extend -- it also applies to the data in the browser right now. Some software packages like Greasemonkey make it possible to write software that runs on top of the software running on a Web page. Greasemonkey can reach right into the Web page code and resize an element, change a variable, or rewrite the text itself. It's like open source coding in real time.

There have been attempts to offer this kind of feature to classical operating systems, but the scripting systems have never had access akin to Greasemonkey's in the browser. Even the most sophisticated scripting tools, like AppleScript, access the code only through an API. Purists may not like someone messing around with their variables, but they don't have as much fun. This is why some of the cleverest tools are available in the browsers.

Browser as ultimate OS reason No. 5: Multiplatform simplicity and mutability

Mobile devices come with browsers. Refrigerators come with browsers. Can mobile refrigerators with browsers be far behind? Why not? Everyone wants to put HTML, JavaScript, and CSS in charge of a rectangle on their machines because it's easy to adapt. Is your screen short and wide or is it tall and thin? It doesn't matter because HTML flows into the space it's given. The CSS-driven layout engine figures it out.

There will be some who point out, quite correctly, that not every Web page looks good on odd-shaped screens. Some websites look like a car hit them when they're viewed on a tall, thin mobile screen. The elements are scattered everywhere, and nothing lines up. Something went wrong with the float styles.

Those problems are fading as Web designers learn how to plan ahead for the wider range of browser-based opportunities that are appearing. They're learning to be flexible and elegant so that the content can flow easily regardless of the device on which it will appear.

Browser as ultimate OS reason No. 6: A clean abstraction layer

The Web's open source foundation encourages rapid evolution of best practices for design. There are still some corners of the tech world -- say, Apple -- where a few designers insist everything be done their way using their native framework. But for all of Apple's success in wielding Vader-grade control, it can't beat the Web. Every innovation created for iOS is quickly imitated and rolled into the major frameworks that dominate the HTML5 world.

The browser's democratic populism lets the best ideas bubble up as everyone constantly experiments. This is in large part due to HTML and CSS, which have evolved into a clear abstraction layer that separates concerns, making collaboration easier for everyone. Designers and programmers can target their specific layer and, where possible, bring in predesigned libraries and frameworks to leverage the work of other designers and programmers in their own code.

Browser as ultimate OS reason No. 7: Better sharing models for libraries

Libraries have always been one of the biggest sources of headaches for programmers. One application on the computer wants to use Version 3.4.666 of a library, and the other wants Version 3.4.667, but the operating system can only find the wrong one. When things don't align, some call it "bitrot" and others call it "versioning errors." Either way, everyone loses.

The browser world offers a better way of distributing libraries. Many Web pages link to a few centralized copies of popular libraries like jQuery or Dojo. Instead of using their own version hosted with the website, they link to a central version offered by one of the Web infrastructure companies like Yahoo. These are more likely to be caught by the cache, thus saving the next Web page the time of downloading this version of the library.

These centralized versions are neatly numbered. If two Web pages use Version 1.9.1 of jQuery, then the cache will do its job. If one switches to a newer version, both will function. The cache might not save much time until they start using the same version again, but the switch works without a hitch.

The approach is not perfect. If the central copies are corrupted or infected with malware, every website using them could be jeopardized. But when was the last time this happened? Switching to a local version of the libraries, the simplest fix, wouldn't be hard.

Browser as ultimate OS reason No. 8: Fertile, competitive marketplace

Once upon a time, there was only Netscape. Then Internet Explorer dominated. Now it seems like everyone has a browser that's competing. Chrome, Firefox, IE, Safari, and Opera are just the beginning. There are dozens of other minor browsers with their own devotees. The mobile platform has even more.

All of them are competing for eye share. The best one wins, but only until the next upgrade cycle. Then the competition begins again.

This battle breeds quality. The best browsers with the most useful features flourish while the casual hacks disappear. This doesn't always happen in the world, but when it does it's great for consumers. When it's good for consumers, it demonstrates the power of the browser layer.

Browser as ultimate OS reason No. 9: SVG, canvas, vector graphics, great user interfaces

The early Web pages may have been slightly dull, but that was before clever programmers figured out how to animate the CSS properties of a DIV or a SPAN. Now rectangles and the words within can flip, spin, turn, fade, blink, and even -- perish the thought -- just sit there.

If that's not enough, the best new browsers are tightly integrated with video cards and offer almost every feature to the JavaScript programmer. While game designers still need native code to pull off some extreme tricks that push video cards to melt down, almost every one of their software features is available in some form or other to the JavaScript programmer. Animated SVG, the canvas object, and some video can do almost anything. There's even a 3D layer called WebGL that handles three-dimensional rendering. The browser will never be able to compete with the consoles or native games, but it'll do a good job when the graphics aren't too complicated. That's more than enough for great games.

All of this means that building a user interface for a Web page is now much simpler than creating one for a basic app. Designers can work with HTML, JavaScript, and CSS, three easy languages that are much simpler than the Java, C++, or Objective-C used for native apps. Once again, easier coding attracts more programmers who create more code and make the platform dominate.

Browser as ultimate OS reason No. 10: Node.js

Perhaps the ultimate proof of the success of the browser as a platform can be found in Node.js, the server-side framework that enables browser programmers steeped in JavaScript and closures to write instructions for the server without learning PHP or Java.

The package offers spectacular performance for some jobs simply by tossing aside the threaded model common in past generations. Instead it adopts the callback function, one of the idioms of browser programming, to juggle the workload. In the right hands, programmers can sidestep the dangers and produce a clean mechanism that dishes up the information from the server quickly and efficiently.

This is a bit of a victory for the JavaScript world because many sneered at the complicated closures and callbacks of browser programming, viewing them as convoluted and overly nested. Yet now that the results are fast, people are being more accepting. Speed and thrift have a way of winning over converts.

Is there anything left for JavaScript, HTML, and CSS to conquer? If PhoneGap colonizes the mobile world, the browser controls the desktop, then Node.js represents one last, big piece. Heck, IBM mainframes often run instances of Linux, which means they also run Node.js.

Next up for the ultimate OS: the computer in your car.