TCPHP Sep 17, 2005 Meeting
Good programming practices, programming structure, and error handling.
attendees:
Matthew Purland - speaker
Blaine Garrett
John Petterson
Allie Micka
Scot Jenkins
Steve Franklin
Dave Ornsby
Rodney Griffin
Jim Caughman
Jason Heiser
John Phillips
Keith Connelly
Dan Rue
Introductions:
We're in search of new meeting space. The following suggestions were mentioned:
Black Bear Crossing (Como Park)
60th & Nicollet - (Keith Connelly)
Courage Center in Golden Valley (Rodney Griffin)
Recommended Books:
Code Complete
Design Patterns
drupal is all procedural code
don't use the one function per file for includes
only do one layer of includes (don't have a function/file that includes other files)
Use include_once() or require_include() over include() or require(), respectively.
parse_ini():
- handles name=value
- allows comments in the config file
- returns an array
2 kinds of error handling
1. syntax - use echo, die, etc... to debug
2. runtime - db is down, how should your code react
check data types
check connections are open
check string lengths, input validation
check return codes of fn's
check data returned by a function is what you expect it to be
custom error handlers, trigger_error
xdebug - "pickel" module; good for debugging
pear install xdebug
pear library written in C
pretty prints vardump
does a full stack track on any error message
php.ini setting:
display errors on/off
log errors on/off
Did you find these notes helpful? Please consider attending a meeting,
taking notes, and posting them to the TCPHP web site to keep the group
growing.

