Thursday, July 4, 2013

Book review: Programming the Mobile Web

Programming the Mobile Web "Mobile web" is vast landscape. It has always been fragmented, with standards bodies pulling one way and browser developers trying to ignore them and do their own thing—whether to stand out or to get that new release out the door quicker. A developer who wants their web site to work and look good on a wide variety of devices had to either be as conservative as possible (1990s-era HTML tends to look the same everywhere), or to buy a room full of mobile devices for testing.

With Programming the Mobile Web, the author Maximiliano Firtman put his roomful of mobile devices through their paces. For designers, the book explains what can be done on today's devices. For developers, it explains what protocols and file formats are supported on which devices, what screen resolutions to expect, how to query for capabilities, and how to gracefully degrade functionality when certain features are not available. The coverage of protocols and file formats is impressive, going all the way back to WML and covering all the way up to HTML5, CSS 3, and modern Javascript libraries. It also covers HTML5 new features, including local storage, geolocation, and improved media support.

Reading this book, you may feel like you're getting mentoring from a long-time, grizzly web developer who's been deep into it from the very beginning. An example of a bit of wisdom from the book:
When you load an image in a web application, the original file size matters only in the data transfer. Once the file is on the browser, it is decoded in memory and it is always treated as a bitmap. Therefore, the size in memory can be calculated as width × height × bits per pixel. We should be careful, therefore, about loading big image files even if they are small in terms of bytes. Just to give an example, a full-screen image on a third-generation iPad will typically use around 12 MB of RAM.
Using more RAM will impact website performance when loading, scrolling, and returning from a frozen state (for example, when changing tabs).
Obvious? Maybe, in retrospect. As a programmer, I've known that graphics chips and low-level rendering routines don't deal with PNG, but rather with bitmaps that occupy RAM. But I didn't apply this knowledge to mobile web until reading this. This book has more than its share of these.

However, this is not a programming book per se. The best way to treat this book is as a companion to web programming books like the classic JavaScript: The Definitive Guide. Programming for Mobile Web will tell you what to be aware of across a wide swath of devices to ensure a consistently reliable and pleasant user experience, and it'll guide you to make good design decisions. Then once you know what you want to do, programming books will see you through the implementation.

Programming the Mobile Web Programming the Mobile Web
How do you take advantage of the new opportunities opening up in mobile web development? With this book, you'll learn the intricacies and pitfalls involved in building HTML and CSS-based apps that you can extend to work with particular devices, including the iPhone, Nokia, Blackberry, Android devices, and other smartphones. You'll not only learn how to deal with platform variations, finicky browsers, CSS compatibility, and other issues, but also how to create pleasant user experiences in a constrained environment.