HTML5: Up and Running

HTML5: Up and Running by Mark Pilgrim
$29.99 from O’Reilly Media

It might surprise you to know that every major browser, including Internet Explorer, currently supports some elements of HTML5. Unless you’re obsessed with web standards, though, you’ve probably been waiting on the HTML5 books to release before fully diving in. Wait no more!

I want to be clear: HTML5: Up and running is not a tutorial on HTML; the assumption is that you already know how to build a simple webpage. If not, there are probably millions of websites that can get you going. This book was written for one purpose: to show you how HTML5 changes webpage design, and how you can use it to provide a better user experience.

Chapter 1, How Did We Get Here, is a bit of an overview; it discusses the history of HTML and previews some of the things that will be covered in the book. This chapter is of mostly historical interest; you don’t need to read it before you get started, but it’s short and an interesting read. The rest of the chapters are broken down by feature, so you can jump around to what you need (although it’s a good idea to read chapter 2 first). In fact, when I started using this book a few months ago, that’s exactly what I did; I needed to know how to do HTML5 video so I started with that section. While the book only released  about a week ago, much of the content was available online before going to print, and I referred to it extensively when I started working with HTML5.

Chapter 2 covers detecting HTML5 features; every modern browser supports a different subset of these, so if you’re relying on a feature, you need to make sure the user’s browser can understand it. This chapter is basically a list of features, such as the new canvas element; after each feature is code showing you how to detect support for that feature by either checking for it in the DOM or using Modernizr, an open-source JavaScript library designed to let you easily detect support for various HTML5 and CSS3 features. Throughout the book, if a feature is not supported in every major browser, the book either shows how it degrades gracefully or provides a workaround.

Chapter three discusses the new semantic elements in HTML5 and discusses how it simplifies web markup. I actually got excited reading this chapter just from how much easier it is to set up the document now; those long, complex DOCTYPEs that you have to copy and paste are now replaced with a simple <!DOCTYPE html>.  Several simplifying things like that make this my favorite chapter; I love something that makes my life easier. If you’re not familiar with the reason for DOCTYPEs and how browsers render different types of documents, there’s also a good explanation at the end of the chapter.

Chapter 4 (which is currently available as a free download on the O’Reilly page for the book)  discusses the canvas element, which creates a blank surface you can use javascript to draw on, thus giving you more control over your images. Amazingly, every modern browser supports the canvas tag, although IE requires a third party library. This chapter is all about drawing on your pages.

Chapter 5 covers the new video tag, which is supported by all major browsers other than IE and Firefox 3.0. Want to make sure that iPad users can see your videos? Skip flash and embed them directly with HTML5! In practice, if you want them to display on every platform and browser, you actually end up doing several encodings to cover all the modern browsers, plus Flash for IE to fall back on. Aside from how to embed the video, this chapter covers how to do your encoding so the video is ready to use.

Chapter 6 covers geolocation: providing services based on where the user is. Unlike other features of HTML5, the user must specifically allow your site to take advantage of his location; calling the geolocation functions will pop up an unconditional (that is, the website cannot bypass it) permissions box asking the user if the site should be allowed to use his location, and whether it should remember that choice. Users can also set separate permissions for low- and high-accuracy geolocation.

Local storage, which allows you to keep information on the user’s hard drive like a cookie (but without having to send it back to the server with every HTTP request,  unlike a cookie!) is actually supported in the latest version of every major browser; even more astonishingly, they support it consistently, allowing each website to store up to 5MB of information on the user’s hard drive. Chapter 7 discusses how to use it.

In the days of high-speed internet, people tend to be always connected…but of course, this isn’t true of mobile devices, which may need to find a wifi connection. Offline applications, which are supported by everything except IE and Opera, allow a web application to automatically download all needed files to the user’s computer, allowing the user to keep working even without a connection; after the connection is reestablished, the application can resync with the server. Chapter 8 discusses some tear-your-hair-out problems that can come up while debugging offline applications.

HTML5 introduces a number of new attributes and types you can use with your web forms. The nice thing about them is that, while no one browser supports all of them, they all degrade gracefully;  unrecognized attributes are ignored and unrecognized types are treated as text, so while older browsers may not see all the bells and whistles you’ve added to your forms, they’ll still work just fine. Chapter 9 shows how you can make your sites more usable with these new form options.

Even with all the new things that the HTML5  specification adds (over 100 new elements!), it still won’t do everything that some people want it to do. Microdata allows you to add your own custom vocabulary to a webpage; it lets you apply additional semantics to data that already exists on the page. Chapter 10 discusses how to use microdata; while no browser currently have native support for microdata, Google does use it Thus, while adding microdata now probably won’t make a big difference to your user experience, it can affect how search engines display results from your site, hopefully improving your search traffic and helping users find what they’re looking for.

The book also includes a short appendix repeating the code for detecting all the new HTML5 elements that need to be detected, along with another recommendation to use Modernizr instead.

Final impressions? As you can probably tell from the length of this review, I loved the book. I did have one minor quibble, unrelated to the content:  the text wasn’t aligned correctly with the page, which looks a little weird, but it doesn’t affect readability. I was sent an advance copy of the book, so for all I know they may have corrected this by now. Overall, though, I found the book extremely readable and informative and feel that it gave me a good grasp of the capabilities of HTML5. Although I’d previously read most of the book online, I love having a hardcopy and plan to keep this close to my desk as a quick reference as I move more into using the latest version of HTML. The book is also very up to date; although it was extremely well edited (and I get annoyed by typos easily, so that’s high praise), it seems to have been updated right up to when they went to print; one section mentions that it was written on May 20th of this year. With how quickly computer technology changes, it’s nice to have a reference book with the latest information.

Overall: Highly recommended.

Rating: ★★★★★

Build Your Own Wicked WordPress Themes

Build Your Own Wicked WordPress Themes
$39.95 from Sitepoint (an imprint of O’Reilly)

I’ve been looking to get into designing WordPress themes, so I’ve been browsing through a number of WordPress books lately. They’ve generally tended to call into two types: “here’s how to make a post” and “here’s how all the PHP in WordPress works”. What I needed is a “here’s how to get started building WordPress themes”; fortunately, that’s just what I’ve found in this book.

The book is reasonably short (just under 200 pages, not counting the preface and index) and is divided into eight chapters. The first is the obligatory “Introducing WordPress”. Chapters two and three cover how to plan and design your theme; this is the type of stuff you do before you start programming, so you don’t get halfway through the coding and realize that what you were envisioning isn’t going to work correctly.

Chapter four is the one that really got me started; it introduces theme frameworks, which act as a scaffolding on which you can build your theme. After reading this chapter, I was able to jump right in to extending the recommended Thematic framework. Theme frameworks provide basic functionality  (and even more hooks) and are meant to be extended with child themes; they let you jump right into developing the appearance of your theme without having to spend time getting the basic elements to work correctly.

Chapter five explains how the various files work together and introduces you to some sample PHP code. Have no fear: if you don’t want to change the functionality if your theme template, you can ignore the php files entirely and code entirely in CSS!  To increase what your theme can do, though, you’ll need to pick up some PHP and dive in.

Chapter six is about widgets and widget-ready areas; again, this is something you only have to pay attention to if you’re working with the PHP. Widgets are add-ons that increase the functionality of your site; when you’re building a new theme, you want to be sure it works with the most popular widgets, and that there are a number of places where the  widgets can be dropped.

Chapter seven is about making your theme easy for the user to customize to meet his own needs. This chapter shows how to add a menu to the administration panel for your theme – a pretty useful trick! You can copy code directly from the book to allow your theme’s users to make changes to the look of the site without knowing any CSS.

Finally, chapter eight is on selling your theme. The authors of this book are professional WordPress theme designers who make their money by doing just that, and this chapter is pretty informative. It also explains how the licensing works for commercial themes, which I had wondered about as WordPress itself is licensed under the GPL.

Overall, this was exactly the book I was looking for; if you want to learn to build WordPress themes,  I highly recommend it.

Rating: ★★★★★

Tapworthy: Designing Great iPhone Apps

Tapworthy by Josh Clark
O’Reilly Media, $39.99

How is an iPhone app different from any other program? The mobile platform means that users often have only short periods of time in which to work; to be successful, your app must be intuitive and easy to use. Josh Clark breaks down mobile apps into three purposes: microtasking (user wants to accomplish a quick task), local (user wants to accomplish something based on his location) and bored (user wants to be entertained).

A large part of designing programs for the iPhone, of course, is accommodating its unique physical design. Partially, this means designing for thumbs: how can you make your app easy to use for someone who is using it with one hand? Apple has determined the width of a thumb to be 44 pixels, and tends to make their buttons at least 44 pixels in at least one dimension; Josh recommends that you do likewise. Other considerations include icon placement; controls, for example, tend to be placed at the bottom of the screen where they’re easy to reach, while information (and dangerous controls) end up at the top, where they are inconvenient to touch.

The book covers different navigational structures, making your app unique, interruptions, and a number of other topics that make your app’s interface fade away so the user can focus on content. Make no mistake, this is not a programming book; it focuses entirely on the design of the application and involves no code whatsoever. I wouldn’t call this a particularly entertaining book, but if you want to make usable apps, it’s worth a read.

Rating: ★★★★☆

SEO Warrior

SEO Warrior by John I. Jerkovic
Way back in 2008, Google announced that they had found over one trillion unique URLs on the web. As the amount of available content explodes, it becomes very difficult for a new website to get noticed. The art of pushing your website to the top of the search results is known as SEO: Search Engine Optimization.

Type SEO into any search engine and you’ll get back an amazing amount of information, half of which will be outdated or flat-out wrong. A good up-to-date primer on SEO techniques can be found in the subject of this book review, SEO Warrior from O’Reilly. Let’s start with a brief overview of what’s in the book.

The first three chapters are an introduction to the purposes of SEO, setting up your website, and how search engines do what they do, while chapters four and five describe the main elements that determine how search engines rank your site. The remaining thirteen chapters go into detail on assorted tools and traps to be aware of when designing and promoting your site.

Although the theory behind SEO is fairly straightforward – put up good content and help the search engines to find it by means of clean pages and incoming links – in practice, getting the top rankings requires a lot of work and research, and it’s helpful to know about the best tools. What I felt was the greatest strength of this book was that not only does it describe in detail how to use many of the most important tools available online, from Google Analytics to XML Sitemaps, a number of useful php and perl scripts are provided as well. Additionally, the companion website contains all the scripts for download, as well as additional content.

Overall I found the book to be very readable and full of useful information; while no book in this area can be totally comprehensive, this is the best one I’ve read thus far. Highly recommended.

Rating: ★★★★★

American Casino Guide – 2010 Edition

American Casino Guide by Steve Bourie
Casino Vacations Press

This book consists of three distinct parts.

The first is a description of various casino games and how to play them. In my opinion, this is the weakest section of the book; while it’s good enough to get a beginning gambler up to speed quickly, it contains multiple mathematical errors, some of them pretty basic; for example, it says that you’re more likely to get a full house than a flush. Still, if you just want to know how to play the games so you can get to it, this is good enough.

The main part of the book is a listing of casinos. I read the chapter for my state – Colorado – and was surprised at how many there were. For each state, you get an alphabetical listing of casinos, a map showing where they are, and basic details such as which games each casino offers. If you’re looking for something specific, this could save you a lot of time.

The last section, of course, is the real reason to buy this book; it consists of a number of coupons, mostly for Vegas. This includes everything from show and food discounts to free drinks and gambling. Most of them are for downtown hotels, so they won’t do you a lot of good if you plan to stay on the Strip (although there are a few for the Strip as well – the wax museum, something at the Paris, etc). Off-strip hotels are less convenient to get to but also offer better odds; if you’re planning to hit them up, you can get quite a bit of extra gaming using these coupons. The coupons are good through the end of 2010.

Overall, if you’re deciding where to go gamble or if you plan to visit downtown Las Vegas, I recommend this book.

Rating: ★★★★☆

iPod: The Missing Manual

iPod: The Missing Manual by J. D. Biersdorfer

A few months ago, I received my first-ever ipod, the 3G touch. I’m fairly tech-savvy, but I knew the ipod must have a lot of hidden capabilities that I could take advantage of, so I preordered this book. I have to say I was very disappointed. On the upside, the book is easy to read; on the downside, that’s because there’s not much to it. Most of it is fairly obvious stuff that you can figure out in about five minutes of playing with the ipod, such as how to add music and photos, shop the itunes store, and make a playlist. While there were a few useful hints (such as adding lyrics), I did not find the book overall to be very informative.

I ended up downloading “iPhone: the Missing Manual“, and it’s a lot better; while some of the material only applies to the iPhone, plenty of it applies to the iPod touch as well.

Rating: ★★☆☆☆

Offworld

Offworld by Robin Parrish

As the book opens, Christopher Burke is lost on Mars, rapidly running out of oxygen, and frantically searching for his crew.

Eight months later, Chris and his crew are two months away from Earth when they lose contact with Ground Control; in fact, they are unable to pick up any communications from Earth. After crash-landing in Florida, they make a shocking discovery: all of humanity is gone. The planet is completely deserted…or almost.

While everything appears as if every living person simply…vanished…two months before, with food on the tables uneaten and cars abandoned on the roads, there is one exception. Satellite imagery shows a bright light shining into space from Houston, and the astronauts immediately head that way to find out what’s going on, only to run into one misfortune after another…and they quickly find that they are not, in fact, alone.

The first chapter of this book is fairly slow; the writing seems somewhat stilted and the author feels the need to define terms that any science fiction reader should know. It picks up quickly, though, and I found myself having trouble putting the book down. The ending is satisfying, if entirely predictable, and while not everything is spelled out, the astute reader should have no trouble filling in the blanks. This is pretty much the literary equivalent of an action movie; not particularly heavy or thought provoking, but a fun read.

Rating: ★★★★☆

Burden of Proof

Burden of Proof by John G. Hemry

Burden of Proof, although set aboard a spaceship, is not primarily a science fiction book. It could be described as “science fiction/military legal drama”, and is completely fascinating as the author intertwines the details of space travel and military law while keeping the story moving. Paul Sinclair, recently promoted to Lt. j.g. (the day the book opens, in fact) is relieved to have life back to normal after having been involved in the court martial of his former captain (A Just Determination).

Life, unfortunately, is about to get a lot more interesting as an explosion in engineering disables the USS Michaelson, killing the chief pretty officer. Something doesn’t look right, and Paul soon comes to believe that the real cause of the accident is being covered up. Unfortunately, all of his evidence is circumstantial, and the suspect is the well-liked son of a powerful vice-admiral.. Burden of Proof is the second book of a four-book series, but easily stands on its own. It was the first book I’ve read by this author; having finished it yesterday I’m already planning to buy the others.

Rating: ★★★★☆

Ruled Britannia

Ruled Britannia by Harry Turtledove
To be free, or not to be free…

In 1588, Spain attempted to conquer England, but was turned back by England’s fire ships. Had the attempt succeeded, however, the result could have been Turtledove’s Ruled Britannia. It is now 1597, and Britain has spent nearly a decade under the rule of King Phillip of Spain. A revolution, however, is brewing, and will drag in a certain British playwright named William Shakespeare…

While no knowledge of either history of Shakespeare is required to enjoy this book, fans of Shakespeare’s work will take particular enjoyment in the blank verse and bad jokes typical of the bard’s writing. While the story is written in modern English, the dialog is partially in Shakespeare’s English, with enough of it thrown in to give the story a period feeling.  My favorite alternate history to date.

Rating: ★★★★★

Java How to Program: Early Objects Version (8th Edition)

Java How to Program: Early Objects Version (8th Edition)
by Harvey Deitel and Paul Deitel

Background: I am a PhD student in computer science, but I do theoretical research that rarely requires coding, so I haven’t programmed in years. Recently I decided to pick up java, which I last used in 2000; rather than taking a class, I decided to spend some time this summer working through this book. I have programmed in several languages in the past (most notably C++) so I am familiar with the basics of programming (OOP, control structures, etc) but as I have not used java in close to a decade, much of the language is totally new to me.

The book is easy to read and has been well-proofed. The topics are covered in depth without assuming that the reader is either an expert or stupid: everything that you need to know is covered, but not repeated over and over. A summary and quiz at the end of each chapter makes it simple to check that you understood all of the important points, and the optional GUI case studies allow the reader to immediately jump in to graphical programming, which is often much more interesting than just causing words to appear on the screen! Chapters are a reasonable length as well; time to complete will vary depending on whether you’re typing out and compiling the listed programs (you should) and doing the sample problems at the back of each chapter, but I’ve been spending 1-3 hours on each. Having just finished Chapter 10, I’ve learned quite a bit, particularly about features of the language which hadn’t yet been added the last time I used the language; the enhanced for loop, for example, is pretty cool! The book comes with a companion website that offers downloads of every program in the book, as well as an additional ten appendices that didn’t fit into this approximately 1500-page book.

The reason this is a 4.5 star review is there is one editing error that annoys me and makes the book a little harder to use. As each chapter involves writing a program and then modifying it, code is necessarily repeated; changes are highlighted in yellow to make it easier to find the places that need to be changed in your code. However, there are several places where the highlighting is incorrect (code that has changed is not highlighted, or code is highlighted without having been changed). It’s a minor issue and only takes a few minutes to figure out; otherwise I’ve had no problems. The book is definitely not perfect, but it’s the best programming book I’ve read so far.

Rating: ★★★★½