Larry Ullman

Translating Geek Into English

Blank HTML5 Reset Templates

As I have little to no design skill, I don’t often attempt to create my own HTML design. It’s really for the best. (When I do sites for clients, I’m normally using HTML and CSS created by an actual designer.) But when I go to write a book, I have to come up with a design to use for many of the examples. In such cases, I try to find something as simple and clean as possible, while still being a bit stylish. HTML5 goes a long way towards this end, as do the many CSS reset tools that have been around for years. Well, HTML5, CSS resets, and more have been beautifully combined in a couple of different blank HTML5 reset templates.

One is the HTML5 Boilerplate, which just came out in version 3. This is a fully-loaded template that includes key JavaScript libraries ( Modernizr, jQuery, and Google Analytics), caching recommendations, server configuration, and more. You can download the template in a well-documented format, a bare-bones file, or a custom creation based upon your desired needs.

JavaScript Best Practices

I recently came across two good resources that discuss some best practices when it comes to JavaScript. The first is an article at Developer Drive, titled Top 10 “Must Follow” JavaScript Best Practices, written by Salman Siddiqui (it’s a good enough article that I’ll ignore the dubious use of quotation marks). It’s a pretty good list, with a range of beginner to advanced topics. I would disagree with one, however: “Better to avoid DOM.” While DOM manipulation is expensive, it’s often required, so I think it’s better to acknowledge that this is a necessary evil we’re stuck with and hope that browsers continue to make improvements in this area. I liken it to the common economic theory that getting a loan to buy a car makes poor monetary sense (because it’s a loan on something that depreciates). The fact is most people need a car to work and make money, so a car loan is often necessary. But I digresss…

Locale-aware Date and Time Formatting in PHP 5.3

\[intlink id="1582" type="page"\]\[/intlink\]\[intlink id="1067" type="post"\]\[/intlink\]

and I had the proverbial egg on my face (what one reader rightfully called my “Dewey Defeats Truman” moment). In truth, only about 5% of the book or so required PHP 6, so it wasn’t a devastating mistake, but I certainly felt foolish.

One of the things I wanted to cover in PHP 6 was locale-aware date and time formatting, as part of the goal of PHP 6 was to recognize the more global Web environment. Even though PHP 6 was shelved, the key components have since been integrated into PHP 5.2, 5.3, and the forthcoming 5.4. Locale-aware date and time formatting was demonstrated in the book using the PHP 6 date_format_locale() function. That function went belly-up, and PHP 5.3 now has the IntlDateFormatter class instead. The documentation for the class in poor, but here’s what I figured out…

Modern JavaScript: Develop and Design Off To the Printer!

I am very happy to say that last week my latest book, Modern JavaScript: Develop and Design, went off to the printer. It’s still slated for a late February release (in the US). Because of the increased page count (624 pages), the price of the book was raised $5.00. However, it seems that Amazon only raised its price like 50 cents. Amazon is currently selling it at $31 (US) and you can buy it using the link below (note: I’ll get an extra dollar or so if you use the Amazon link).

For the first time ever, I plan on selling copies of select books myself. The books will, of course, be signed (inscribed however you want). For the Modern JavaScript: Develop and Design book, I believe I will be able to offer it at $35 $40 (US), plus shipping. This is slightly more than the Amazon price, but I have more overhead (well, different overhead) and fewer employees than Amazon! Plus, Amazon has that whole “economies of scale” thing working for it. I’ll confirm the price and get the e-commerce system setup in the next couple of weeks. If you have any questions or comments, let me know.