PHP
  Home arrow PHP arrow Writing Clean and Efficient PHP Code
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Writing Clean and Efficient PHP Code
By: David Fells
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 138
    2004-05-26

    Table of Contents:
  • Writing Clean and Efficient PHP Code
  • Loops
  • Objects
  • Code Reusability

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Writing Clean and Efficient PHP Code


    (Page 1 of 4 )

    If you've ever had to go back to an application you wrote after an extended period of time, you already know the value of clean, well documented and efficient code. But how can you make your code better? Here are some tips that'll help you speed up and clean up your development cycle.

    Introduction

    Articles preaching the virtues of writing clean code are abundant with good reason: some things bare repeating. Like any topic covering such an esoteric subject, there are a wide range of opinions as to what exactly defines "clean code". At the end of the day, there are two criterion for clean code:

    1. Efficiency: Does the code run as quickly and efficiently as possible? Does the code make the most of it's objects and variables with maximum reuse and minimal waste?

    2. Maintainability: Is the code easy to understand for other developers? Is it well planned, logical, properly documented, and easy to update?

    This article will discuss the various elements comprising these two broad points regarding clean code, and provide examples in everyones favorite open source language: PHP. The target audience here is the beginner PHP programmer, although other levels of PHP programmers may find some useful information within.

    More PHP Articles
    More By David Fells


       · I have been scripting with php 4, and always thought it was ok do just do what i...
     

       

    PHP ARTICLES

    - Using Aliases and the Autoload Function with...
    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Sub Classing Exceptions in PHP 5
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT