I’ve been reading the book Technical Blogging, by Antonio Cangiano, over the past couple of months and am glad that I am. I’m reading it in the hopes of improving the quality of (and, potentially, income from) this blog, and I think it will pan out. Continue Reading…

JavaScript Best Practices

February 10, 2012

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…

The second resource is a presentation titled JavaScript “Best Practices” (again, the quotation marks), by Christian Heilmann. Heilmann presents about 20 specific suggestions and then explains them all in detail. The presentation itself lacks pretty much any style whatsoever, but content is more important, no? There’s lots of code in the presentation precisely demonstrating both good and bad behaviors, along with explanations as to why something is problematic.

I’m in the process of writing my own article, titled “The 10 Best JavaScript Development and Design Habits”, to be published at Peachpit.com. I’ll post a link to that when it goes online.

In the third edition of my “PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide” book, titled “[intlink id=”1582″ type=”page”]PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide[/intlink]”, I went out on a limb and used a beta version of PHP 6 when writing the book. PHP 6 was about half-way done at the time, and I didn’t want to complete the book, only to have it be outdated immediately thereafter (using PHP 6 wasn’t, by the way, an attempt to trick the reader into buying the book, as some cynical people have suggested). Well…[intlink id=”1067″ type=”post”]PHP 6 ended up dying due to many complications[/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…

Continue Reading…

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.

ADDITION: Presumably, the book will be available internationally in time, starting with English-language countries such as Canada, the UK, and Australia, followed by translations in other European countries and Asia (that’s my educated guess, based upon how things have gone in the past). Buying the book directly from me will be the fastest way for international recipients to get a copy, by far. I’ll need to receive my copies of the book before I can estimate the shipping costs.

UPDATE: I just heard back from my contact at the publisher and it will cost me more than I had thought to purchase the book for resale. In order to cover my costs, I’ll need to charge $40 (US) plus shipping. Admittedly, this is almost $10 more than Amazon, but the $40 covers the cost of: the book itself, getting the book shipped to me, and packing materials. I think shipping within the United States via media rate will be around $4.

Top 100 E-Commerce Tips

February 3, 2012

I just recently came across this somewhat old post titled Top 100 E-commerce Tips from WebmasterWorld. Despite the fact that the article was published over four years ago, and it’s based upon a slightly older forum thread, there’s still a lot of material in the article worth reading if you do any e-commerce. Even though there are a full 100 tips here, they’re short—most are just a single sentence—and quite valid. Admittedly, I disagree with a couple, and feel like a few could be tossed out, but there are many good points made, and many reminders of things that perhaps you’ve forgotten to emphasize on your most recent e-commerce. project.