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. Namespaces! That’s What You Want.

See the original article here:
RubySource: Confessions of a Converted PHP Developer: Namespace Superhero!

Tags: modules, namespaces, PHP
Mal Curtis works at Learnable as a Rails developer. He spent most of his 10 years in Web Development as a PHP developer, but saw the light. You can check out some of his projects at GitHub

No Reader comments

Special Offer
Free course!

Git into it! Bonus course Introduction to Git is yours when you take up a free 14 day SitePoint Premium trial.