Larry Ullman

Translating Geek Into English

What is Larry Thinking? #34 => E-Commerce and Newsletters!

In this edition…

About the Previous Newsletter

So the first thing to acknowledge is how the last newsletter turned out…As I mentioned at the beginning of that newsletter, it was the first newsletter sent using a new system (specifically, a commercial WordPress plug-in named Newsletter Pro. To start, I wrote the entire newsletter, entered it into the new system, and sent myself a test newsletter. In that test newsletter, I tested all the links. So far, so good. Then I thought: I should add internal links so “In this edition” list at the top is anchored to the articles below. Naturally, being such a minor detail, I didn’t bother to test this again. And that’s where I went astray! Always test again. Always. As many of you discovered, those links didn’t work at all (the others in the newsletter did, or should have).

20 Things I Learned About Browsers and the Web

The excellent Fi development firm put together a site titled " 20 Things I Learned About Browsers and the Web" for the Google Chrome Team. The site is written in HTML5 (you don’t have to use Chrome to view it but you need a current browser; I used Firefox 3.6.13), with an amazing interface that looks like you’re reading a really sharp book. The book pages turn as if it’s a real book—without redrawing the page. The site also remembers where you were in the “book” when you return at a later time. After looking at a couple of pages, take a peek at the source code (HTML5 is a whole new world).

As for the content, the foreword to the book says, it’s a “short guide for anyone who’s curious about the basics of browsers and the web”. The material really covers the gamut of what the Web is, beginning with TCP/IP in 1974! There are 19 topics, with about 2-3 pages per (the 20th topic is actually a recap). Some of the content is basic—the kind of thing that might help your parents understand how the Web works—and some is sufficiently technical. Initial topics covered include HTML, JavaScript, CSS, and the forthcoming HTML5. Other sections focus on features of browsers: plug-ins, extensions, cookies. The section on Web apps does an excellent job of discussing the benefits that Web-based applications have over traditional desktop ones. Several of the mid- to later sections properly explain the security concerns surrounding Web browsers and the Internet (common fix: use a current and up-to-date browser). And although the site was developed for Google Chrome, it’s not too Google-centric, in my opinion.

Rewriting the E-Commerce Stored Procedures with Standard PHP-MySQL

In the second e-commerce example in my “Effortless E-Commerce with PHP and MySQL” book, stored procedures were used for all of the public-side database-related functionality. This includes: the displaying of product categories, specific items, and sale items; cart and wish list management (adding items, updating quantities, removing items); and order submissions. As I write in the book, stored procedures offer tons of benefits, the most critical being:

  • Greatly improved security
  • Better performance
  • Compartmentalization of code (i.e., adherence to an MVC approach)

However, not everyone can use stored procedures, in particular those on some shared hosting environments. One reader recently said (in the forums) that they couldn’t use stored procedures with their host, so I volunteered to rewrite some of the stored procedures as standard PHP and MySQL. In this post, I’ll rewrite the procedures, and corresponding PHP scripts, from Chapter 8, “Creating a Catalog”.

Rubber Duck Debugging

I recently came across the concept of “Rubber Duck Debugging”, with which I was previously unfamiliar. I first saw the idea on an old Linux mailing list, although there’s a Wikipedia article on the subject as well (of course). You should read the first link (it’s short), but the basic premise is that you can debug code by walking through it, trying to explain the code to an inanimate object (or an animate one, if you want). The theory is that when you get to the point where your explanation doesn’t make sense, you’ve found the source of the problem. I’m personally a big advocate of the “walk away from your computer” debugging approach: when you’re having a really hard time debugging a program, step away from your computer and don’t think about it for a while. In my experience, you’ll either solve the problem fairly quickly after you stop thinking about it, or fix it shortly after returning to your computer with fresh eyes. In any case, you need as many debugging tools as possible in your programmer’s toolbox.

Chapter from "Effortless E-Commerce with PHP and MySQL" Published Online

Peachpit Press, publisher of my book “Effortless E-Commerce with PHP and MySQL”, has posted a chapter from the book on their Web site (technically New Riders is the publisher, but Peachpit owns New Riders). The posted content represents the entire Chapter 4, “User Accounts”, which is the second chapter in Part Two: Selling Virtual Products. The posted content covers how user accounts will be managed in the site (in the particular example, only paid, registered users may access content). The pages walk through the creation of several helper functions, then develop an entire registration, logging in, logging out, and password management system. The chapter concludes with some security improvements one could make.

Aquent's Internet Online Website

Some time ago, I StumbledUpon Aquent’s Internet Online Website!. At first it just looks like a very generic ( very generic) Web page, but upon further consideration, it’s kind of interesting. Aquent, in case you’re not familiar with them, is an international talent agency that specializes in online-related fields: user interface, graphic design, marketing, etc. (I was briefly registered with them, in order to work on a project that never came to fruition). Anyway, just as an X-ray shows the underlying skeleton, the Internet Online Website! shows the common pieces of a Web site and what skills are required to create it. If you’ve been doing Web development for some time, you’re not going to learn a whole lot, but it might strike you just how common much of what you do is (in terms of UI and design). If you’re relatively new to, or less experienced with, Web development, you’ll probably appreciate seeing the basic ideas—specifically including things like marketing, interactive design, mobile Web, etc.—put together.