4 things operating systems should do today…but don’t

This is my 2014 wish list for where operating systems (OS) should be headed with laptops, tablets, smartphones and smart devices. Now before you lambast me or fill my ears with technical mumbo-jumbo about why some of these ideas aren’t possible, just take a slow, deep breath. I offer these concepts up as a challenge to take things to the next level, and not as fodder for a debate contest of what’s possible and what’s not. I hope these ideas are viewed as worthy goals rather than existing only in our imaginations thru science fiction.

I suggest it’s time we rethink operating system kernel theory and discard some of our historical notions of how operating systems are supposed to work. I’m continually amazed that even the newest operating systems, such as Android, have fundamental problems similar to what we’ve had since the earliest versions of Windows! So here’s my list…

No more OS lockups – It’s 2014 and computers still experience software related operating system crashes. In the last year, I’ve personally had brand new Windows machines, Mac’s and smartphones lock up in one way or another. No, it’s not just bad luck. I put the onus and ultimately responsibility back on the OS vendors. A 21st century OS should be hyper-intelligent about memory allocation and reclamation. The OS should be able to gracefully self-recover from everything short of a fatal hardware failure.

No more app crashes – I’m sure the OS developers will blame this on the application developers and vice-versa.  My take on this: app crashes should never happen. There are many well-known bad patterns that operating systems can monitor for and avoid. The OS should be able to detect bad application code and handle it without coming to a screeching halt. Examples that I’m thinking about include:

  • being aggressive about detecting and providing programmatic feedback on memory leak conditions,
  • automatically isolating run-away code blocks so they don’t lockup an entire application,
  • giving applications feedback on whether or not they are on a trajectory to run out of memory rather than simply killing them off,
  • provide not just guidelines but also build-time test tools for analyzing applications and provide pointed feedback on best practices.
  •  some may consider it draconian, but you could be more assertive on failing builds that don’t meet a minimum best-practice standard set by you, the OS manufacturer.

Dynamic updates – We should be able to update the OS and apps while they are running. I really don’t like having to reboot any device that gets updated, and in the case of Windows this can lead to multiple reboots and that is a major pain. This includes phones, computers, as well as TiVo’s, Hoppers and more. I’d like to see OSs model themselves after web pages that can replace specific content on-the-fly without having the refresh the entire page.

Instant boot – OS should allow smart, lazy loading of modules and applications as needed. Do we really need to wait for everything under the sun to load up front while we wait…and wait? My iPad takes some time to boot, my Android Nexus takes even longer, but my MacBook boots within seconds.

So that’s my short list. I hope some OS engineers have a chance to read this and give my suggestions thoughtful consideration.

Deleting an HTML Application Cache

When you are testing web applications that use an Application Cache, also sometimes called the manifest file, you have to delete this file every time you make a change to the application. If you don’t then none of the changes you make to the application will show up. The very purpose of the Application Cache is to semi-permanently store your HTML, CSS, JavaScript and images. It’s becoming increasingly popular for speeding up web app performance, and a requirement for taking web apps offline. In fact, Google now uses an application cache for their home page.

Simply trying to delete your browser cache in the normal way won’t necessarily clear the Application Cache and its associated files. So here’s a quick rundown that will hopefully save you some time.

Chrome – browse to chrome://appcache-internals/.  There may be a number of different caches listed. Select ‘Remove’ for any cache that you want to go bye-bye.

Chrome (Mobile Android) – go to Settings > Privacy (under Advanced) > CLEAR BROWSING DATA, checkbox the ‘Clear the cache’ option and then select the ‘Clear’ button.

IE 10 – go to Tools > Internet Options > Settings > Caches and databases tab. Select the cache that you want to delete and the click the ‘Delete’ button.

Safari (Mobile) – For Safari iPhone and iPad go to Settings and select “Clear Cookies and Data.”

Safari (Desktop) – Simply attempting Develop > Empty Caches may not work. On a Mac you may have to: close your browser, manually delete the .db file by going to //library/Caches/com.Apple.Safari and move any item ending in .db to the trash, then restart browser. If this doesn’t work then try restarting your machine. Yep, it’s an awful workflow and it’s been a known bug in Safari dating back to at least version 6.

Firefox (Desktop) – go to Tools > Options > Advanced > Network > Offline data > Clear Now.

Want to learn more about Application Cache’s? Here’s a good technical overview from WHATWG describing what is an application cache. And, MDN has a good article on Using the application cache.

OSCON 2014: HTML5 JavaScript Storage for Structured Data

Yay, I’ll be at OSCON again this year! My presentation is on July 23, 2014 at 5pm in Portland Room 252. For those of you who aren’t familiar with OSCON, it’s one of the largest [if not ‘the’ largest] Open Source conventions in the U.S. Just take a look at the program schedule and you’ll see topics covering just about every open source project or initiative in existence.

I’ve learned a ton every time I’ve attended OSCON and I’m always happy to give back to the community in the form of presenting on lessons learned over the previous year.  In the past I’ve talked about HTML5 Geolocation and Android GPS. This time I’m presenting on best practices for IndexedDB.

If you’ve ever wanted to store large amounts of data in the browser then you’ve most likely read about IndexedDB. It’s a transactional database whereby you retrieve items via a key.  It’s an especially useful tool for taking data offline. While I will spend some time discussing what it is, I’ll spend most of my time on how to best use it. I’ll also examine the fastest way to retrieve data from the database, and look at considerations for pre- and post-processing which is something that is rarely discussed but can dramatically affect application performance.

I hope to see you there!