Evaluating php programmers
IMHO…
How to spot a bad php programmer:
- Looking at code
- Registered Globals
- Unsanitized db queries or include based on user supplied data.
- eval
- Production code that throws warnings (such as identifying elements of an associative array without using quotes.
ie $array[element] instead of $array[’element’]) - Limited or no code reuse. In particular DB queries should almost always be done in included functions or classes. Unnecessary new lines
- Presentation mixed into business logic
- Code that goes beyond 120 columns
- Magic Quotes
- Looking at example web sites
- GZIP’ed not enables on html
- Showing errors or warnings (which means code can cause errors or warnings, and then the user is notified)
How to spot a good php programmer:
- Looking at code
- Good OOP (I pity those that have to deal with bad OOP)
- User supplied data sanitized in a htaccess where possible in addition to code
- The ternary operator
- For image uploads verifying image validity and resaving the image with gd and a quality setting of 85 or less.
- Caching
- A templating system (even if it is very basic)
- Source code control
- Some sort of notification when queries fail.
- Insert queries that do list column names
- Looking at web sites
- Friendly URL’s
- GZIP’ed CSS and JS
- 301 redirection (and no more than 1)
- (x)html that validates
I have been guilty of many of the above vices at one time or another, and do not yet practice all of the above virtues. Sooner or later I think I will drink the cool aid and embrace MVC, though at this point I despise enforced MVC.