Welcome Guest, Not a member yet? Register   Sign In
[split] Namespace length (CodeIgniter4 Roadmap?)
#1

(This post was last modified: 06-24-2016, 09:17 PM by ciadmin.)

Hi, is it too long for the namespace \CodeIgniter ?
e.g
PHP Code:
class Process extends \CodeIgniter\Controller {
 public function 
__construct() {
 
  parent::__construct();
 }


what if something like \CI\Controller ..
I love the way CI_Controller easy to type and compose classes

sorry for bad english I hope you understand my point
God Bless CI Contributors Smile
Reply
#2

While I definitely understand how it would be nicer to type less and use something simpler like CI, that doesn't keep it really all that safe from name collisions with other packages. Someone might have initials CI, or might have a company with that name, or might be part of a continuous integration server, etc. To keep those namespaces from colliding we have to keep a more descriptive, read longer, namespace.

Good IDE's can insert that for you. Good editors usually have some form of snippet solution that can help reduce typing like this, and there are tools like TextExpander that can help you throughout your operating system, if you want to use them.
Reply
#3

(This post was last modified: 06-24-2016, 11:07 PM by marksman.)

(06-24-2016, 10:46 PM)kilishan Wrote: While I definitely understand how it would be nicer to type less and use something simpler like CI, that doesn't keep it really all that safe from name collisions with other packages. Someone might have initials CI, or might have a company with that name, or might be part of a continuous integration server, etc. To keep those namespaces from colliding we have to keep a more descriptive, read longer, namespace.

Good IDE's can insert that for you. Good editors usually have some form of snippet solution that can help reduce typing like this, and there are tools like TextExpander that can help you throughout your operating system, if you want to use them.

Now I understand the reason why. The reason why I love CI_Controller and CI_Model its because I use shift once. unlike I type CodeIgniter I use it twice, but its not a bigdeal but I think it will be an issue for me. I use to misspell the words with shift. as what you have said good IDE may solve my problem in typo errors.
God Bless CI Contributors Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB