I have a question about namespaces.. The PHP manual says the following:
- Name collisions between code you create, and internal PHP classes/functions/constants or third-party classes/functions/constants.
- Ability to alias (or shorten) Extra_Long_Names designed to alleviate the first problem, improving readability of source code.
Yii2 currently uses "sub-namespaces", meaning something like:
In my opinion, this doesn't alleviate the Extra_Long_Names problem. It might even make things more complex. ("Which namespace do I need to include??")
What about we have 3 namespaces?
- ext (this one would need sub-namespaces to avoid name collisions)
Then we could just do:
<?php namespace app; use yii;
Nice and simple! Thoughts?