« How to assemble a Feedburner alternative using Wordpress plugins by Samir | Main | July 28th, 2007 Blog Carnival Table Of Contents »
Building Better Web Apps From the Inside Out by Chris
By Derek Brown | June 28, 2007
Haphazard would be the best word to describe my web development abilities when I started out a little over a year and a half ago. My code was disorganized and poorly named. I had barely even heard of usability. I was uploading every small change during development to my shared server. I could go on and on. The point is that had no idea HOW to properly develop a web site even though I had become fairly comfortable with the programming languages I was using. By all means, I’m still not an expert in web development, but the following is what I’ve learned so far on coding smarter, streamlining your workflow, and increasing usability.
Coding Smarter
- Structure database columns with descriptive ENUM values. Using True and False or Yes and No can quickly become confusing. Instead try using values such as Accepted and Denied or New and Deleted.
- Name your functions and classes to serve as your comments. Instead of naming a function “get_post” which is ambiguous, you could call it “findNewestPost”, “findUsersPosts”, “findAllPosts”, or “findAllPostsInLastTenDays.” The last example is a little long winded, but I tend to err on the side of length if it makes my code more readable.
- Give your loop count variables specific names. Using “$i” or “$j” can become very confusing especially when you are working with nested loops. Instead, use variable names such as “pageCount” or “userCount.”
- Organize your functions. Try sorting by functionality such as inserting, deleting, updating, selecting or alphabetically. Whatever you choose, just keep it consistent across your entire project.
- Adhere to a coding standard. A couple of choices are PEAR Standard and Zend Standard . If you can’t find one you like, draw up your own!
- Use a framework. Find one you understand and learn it or build your own. It’s pretty amazing how much time and effort these gems can save you in the long run. My PHP framework of choice is CodeIgniter.
< Continue >
Enjoy Your Read? Great! Buy Me A Drink? Sphere: Related ContentTopics: [Digi]Blog Carnival June 28, 2007 |









