Monday, October 23, 2006

Ten Commandments for Programmers

  1. Thou shalt not worry about bugs.
  2. Bugs in your software are actually special features.

  3. Thou shalt not fix abort conditions.
  4. Your user has a better chance of winning state lottery than getting the same abort again.

  5. Thou shalt not handle errors.
  6. Error handing was meant for error prone people, neither you or your users are error prone.

  7. Thou shalt not restrict users.
  8. Don't do any editing, let the user input anything, anywhere, anytime. That is being very user friendly.

  9. Thou shalt not optimize.
  10. Your users are very thankful to get the information, they don't worry about speed and efficiency.

  11. Thou shalt not provide help.
  12. If your users can not figure out themselves how to use your software than they are too dumb to deserve the benefits of your software anyway.

  13. Thou shalt not document.
  14. Documentation only comes in handy for making future modifications. You made the software perfect the first time, it will never need modifications.

  15. Thou shalt not hurry.
  16. Only the cute and the mighty should get the program by deadline.

  17. Thou shalt not revise.
  18. Your interpretation of specs was right, you know the users' requirements better than them.

  19. Thou shalt not share.
  20. If other programmers needed some of your code, they should have written it themselves.

Sunday, October 22, 2006

osCommerce Users Group on MySpace

osCommerce Users Group on MySpace

For everyone that has a MySpace account a member named Mark has started a users group. Stop by, join, and network with osC users, developers, designers, and other people interested in the platform.

See you there!

Thursday, October 19, 2006

Zend Certified Engineer

Bobby Easland, Zend Certified Engineer

The Zend Certified Engineer exam has some very tough questions but is well within reach. Programming eCommerce platforms tend to utilize only a small number of core functional areas of the PHP language (file functions, cURL/sockets, DB, etc.) but the exam is very balanced. Anyone that is looking to take the exam should purchase the study guide and maybe even the practice questions book. Both of these helped me to understand the key areas that would be addressed and highlight those areas that I needed to brush up on.

I highly encourage my fellow osCommerce and eCommerce developers to look into the certification exam. It is very satisfying to obtain the certification directly from the architects of the PHP language and also brush up on the skills that may not be commonly used.

I would rate my experience with this certification as a 9 out of 10. Good luck to everyone on their path to certifying your skills and experiences!

Thursday, October 05, 2006

1 Billion Queries Served in 10 days

I've been working on a high volume client completing a very customized platform. They needed such things as support for 10K+ concrete products and virtualization to bring that total up to 100K+. The core modifications for this were extensive but not only did it need to accomodate functional requirements but also scale with enterprise level traffic (10,000+ concurrent users). As if that weren't enough they also needed to integrate seamlessly with their distributor servers for regular XML inventory and orders updates.

The solution for the product virtualization entailed that I first remove the stock osC attrbutes system since IMO it is useless for large catalogs. The shear amount of administration for each product setup would have been several thousand man hours and taken weeks if not months. Another requirement was that inventory be tracked per option. For example, let's say that there is a costume called "Test Costume". There are several attributes (or options) such as size, color, etc. As each one is sold out it needed to be removed from customer display. All of these were easily handled with the highly customized options core.

The next task that was approached was the XML integration with the distributor. Basically this is a complete backoffice integration that syncs not only the inventory levels but also the orders. As the order goes through received, picking, and finally shipped it updates the orders status with customer notifications. In addition, it is fault tolerant with queue redundancy.

Now the fun problem to work on...high traffic volume. For this I naturally selected a clustered configuration with multiple web, load balancers, and DB servers. The cluster currently can support 5K concurrent users without breaking a sweat. In the future if the site encounters a traffic spike (AdWords campaign, etc.) scaling is as easy as adding another node and a fast configuration change in the load balancer.

Since the cluster went live 10 days ago it has served almost 1 billion queries and climbing by about 100 million queries daily. All the while it is sustaining sub .1 second page render times.

...so...for all those people that have been asking me what I've been working on there you go. Want to see the site? Here you go: Halloween Costumes

Monday, July 10, 2006

How to remove session ID appended URLs from the search engine index

A common scenario is for store owners that were not aware of the "Prevent Spider Sessions" option to have several URLs indexed by spiders with the session ID appended. This situation is troublesome and there are a few options to handle referrals sent through the "wild" session ID URL.

However, the true solution to the problem is to REMOVE THE SESSION ID's from the search engine index! So, how hard is it? Pretty easy!

In includes/application_top.php find this code:

Under that paste this code:

This code will redirect the spider to the non-SID URL with a 301 header and over time will remove the session appended URL from the index.

Friday, June 16, 2006

[CONTRIBUTION] Google Sitemap Generator for osCommerce MS-2.2 stores - Categories

After posting the latest version of the Google Sitemap Generator for the catalog products there have been several people request that I also post the one for categories.

So, I have also posted the latest sitemap script for the categories on Digital Point forum as well!

I posted the code inline with the post so that you can inspect it and see how it works. However, I have also attached the file so as to eliminate copy-and-paste errors that will inevitably occur.

If you register on the forum to directly download the file be sure to fill in my screen name (Chemo of course!) so that they know who sent you :-)

Get the new script here: Google Sitemap Generator v1.1 - Categories

Sunday, June 11, 2006

PHP4/MySQL Error Handling with an Observer design pattern

I put up an article on Digg.com just to see what kind of response it gets. If people find it useful I'll post more articles on PHP design patterns and some interesting solutions to common problems. Here's the link: PHP4/MySQL Error Handling with an Observer design pattern. If you dig the article...be sure to give me a DIGG! :-)

Google Sitemap Generator v1.2 (osCommerce MS-2.2) - by Chemo

I have recently joined the Digital Point forum and will be releasing never before published scripts for osCommerce based stores. In addition I'm going to post articles on PHP design patterns, application architecture, and of course example scripts.

The first script that I'm releasing is the followup to my Google Sitemap Generator contribution. As some quick history...exactly 12 hours after I released the v1.0 script I was banned by Harald and the osCommerce team from the community. As a result I never had the change to properly support the contribution and of course was not able to release further developements.

Get the new script here: Google Sitemap Generator v1.2