News Feed
Sections




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

RubySource.com:
Confessions of a Converted PHP Developer Namespace Superhero!
July 29, 2011 @ 12:43:50

RubySource.com has posted another in their "confessions of a converted PHP developer" series (more here) with a new article comparing namespacing between the two languages.

The moment you start writing code that grows beyond a few classes, you start to realise that you need a way to group files and logic. While this is easy to do, it can become quite difficult to ensure that you have class names that are unique and don't end up accidentally clashing with other classes in your own code, or classes in other people's code that you are using.

He talks about PHP's namespacing, a relatively recent addition, and how pre-5.3 "pseudo-namespacing" was done through class and directory names with autoloading. He compares this to Ruby's module support that provides a sort of built in namespacing support. He includes a multiple namespace Ruby example and shows how to nest modules for even more fine-grained separation.

0 comments voice your opinion now!
rubysource converted developer namespace module ruby


blog comments powered by Disqus

Similar Posts

Job Posting: Adknowledge seeks Sr. LAMP Developer (Rochester, NY)

Job Posting: Perforce Software Seeks Web Application Developer (Victoria BC, Canada)

Job Posting: Blue State Digital Seeks PHP/AJAX developer for politcal/tech consulting (Boston, MA)

Job Posting: McDonald Group (Recruiter) Seeks PHP Developer (Bend, OR)

Job Posting: UJA-Federation of New York Seeks PHP Web Developer (New York, NY)


Community Events

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


conference interview application extension version performance laravel symfony2 series introduction opinion api library example podcast voicesoftheelephpant community release php7 framework

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