PHP Classes
elePHPant
Icontem

Bad Practices

Recommend this page to a friend!

      Shopping Cart  >  Shopping Cart package blog  >  AJAX Shopping Cart wi...  >  All threads  >  Bad Practices  >  (Un) Subscribe thread alerts  
Subject:Bad Practices
Summary:This tutorial teaches a number of poor practices
Messages:1
Author:Sean M
Date:2015-10-09 13:42:37
 

  1. Bad Practices   Reply   Report abuse  
Sean M - 2015-10-09 13:42:37
There is a lot wrong with this tutorial.

1. The meta keywords tag has been useless for a decade
2. No use of PHP short echo tags when they would be very useful, IE "<?=" vs "<?php print"
3. Using tables for layout, and attributes like "align" that have been deprecated since IE7
4. hardcoding the parameters required by the cart methods instead of using method parameters
5. Bad grammar, like "Cart been emptied." and "Product have been removed."
6. Using an "action" parameter instead of just using different URLs or request methods
7. No autoloading, and non-public PHP files exposed in the document root
8. Using a float instead of an integer for storing financial information

The only thing that separates this tutorial from tutorials written in 2005 is the usage of PDO instead of the mysql functions, and is a reminder why PHP Classes isn't taken seriously among the developer community.