News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Court Ewing's Blog:
Organize Your Project like a Pro with PHP Namespaces
April 19, 2010 @ 21:04:30

Court Ewing has put together a new post looking at using one of the more powerful (yet underused) features of the recent PHP releases - namespaces - to organize your code.

Prefixes serve their primary purpose well: when used correctly, they will ensure that your class names do not have naming conflicts. Unfortunately, they are long and pedantic, and provide no additional benefits. [...] Namespaces provide other benefits than shorter class names, though.

He illustrates with a well-structured example that makes it clear as to what resources are being used and how they're split out. His snippet defines the structure of the rest of the script without even a line of code in the class. He also briefly mentions the PHP 5.3 adoption levels and notes that several larger projects will be 5.3-only soon and will start to force the hand of developers and hosting companies.

0 comments voice your opinion now!
namespace organize project tutorial adoption


blog comments powered by Disqus

Similar Posts

Limitless Studios: Determine Number Of Online Users Without A Database

Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 7)

NetTuts.com: An Introduction to Views & Templating in CodeIgniter

SitePoint PHP Blog: Understanding Drupal's EntityFieldQuery

WebReference.com: Creating a Custom RSS Feed with PHP and MySQL


Community Events

Don't see your event here?
Let us know!


api symfony introduction language library extension community voicesoftheelephpant laravel5 podcast laravel security unittest release series interview version framework threedevsandamaybe opinion

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework