Pretty, solid code

Track: 
Coder
Experience: 
Beginner

Have you ever forgotten to return the menu items array in an implementation of hook_menu? Then after spending a frustrating hour you know that very small errors can make Drupal really disgruntled.

PHP is a wonderfully flexible programming language, but its flexibility also opens a lot of dangerous pitfalls. The goal of this session is to make you think about PHP code and how to make it more robust. We all write code that has the occasional error or bug in it (at least I do), but there are a number of best practices and tricks that can make it easier to find the bugs and errors early on. Both Drupal core and contributed modules contain some good, tested, and reusable functions that all programmers should know and use instead of writing the same code. The session will go over some of the ones I find that are the most helpful.

Coding standards are important for any software, but as Drupal is growing it becomes more and more important that we all adhere to the standards. I will cover ways to quickly ensure that your code is up to the formatting standards.

Intended audience: 

This session is for anybody that writes PHP code, but if you just started writing Drupal code, this session will save you a lot of pain and late night debugging.

Seasoned PHP/Drupal programmers might know most of the things I will go over, but if you are like me - you cannot gather too many programming tricks :)

Questions answered by this session
Question 1: 
Why is my code not working?
Question 2: 
What common coding pitfalls should I do my best to avoid?
Question 3: 
How can I make my code more readable to others (and myself)?
Question 4: 
How can I test my code easily?
Question 5: 
What functions from core and contrib should I know to make my life easier?
2.411765
Your rating: None Average: 2.4 (17 votes)

Diamond Sponsors

 
Palantir.net
VPS NET

Platinum sponsors

 
workhabit
Trellon

Gold Sponsors

 
Duo
Treehouse Agency
Drupal Connect
Microsoft
HotDrupal.com
NorthPoint
Chapter Three