Coding Conventions

What's the difference between good code and bad code? Actually, it's very simple. Good code—really good code—can be read almost like a book. You can start anywhere and at once you know what the lines you're reading are used for, under which circumstances they're executed, and any setup they might require. Even if you lack background knowledge and encounter a sophisticated and complicated algorithm, you'll at least be able to see quickly which tasks it performs, and under which aspects it performs them.

It would be easy to simply show examples and say, "Do as they did," but we'd like this chapter to impart a solid basis for writing professional code—a basis that makes the difference between truly well-crafted code and an ...

Get Web Application Development with PHP 4.0 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.