Question

This may be a really stupid question. As Kohana 3 requires a directory to be created in order to be able to use underscores in the class name, the question is :

a)Should I create a directory structure in order to be ableto have class names like :"My_Super_Cool_Class_Name" (with a structure like my/super/cool/class/name.php)

b)Should I mix underscores and camelCase in order to avoid such a messy directory structure, so I have "My_SuperCoolClassName" (with a structure like my/supercoolclassname.php)

Again, this may be a very stupid question, the first option seems right to me, but at the cost of having a little absurd directory structure, the second option seems more agile, but then the class names will follow not convention, or even worse, a mixed convention (camelCase and under_scores).

Anyone able to inspire me? (sometimes I really miss Java and its beautiful packages :)

Was it helpful?

Solution

Underscores just helping us create a structure. It's not for spaces between words.

It's nice to use My_Super_Cool_Class_Name if you have structure like:

My
 Super
  Cool
   Class
    Name
    Surname
    Surname45
   Glass
    Name
   Gas
    Name
  Cool1
   Gas
    Name
  Cool56
   Gas
    Name
 Middle
  Cool
   Class
    Name
    Surname
    Surname45
   Glass
    Name
   Gas
    Name
 Puper
  Cool
   Class
    Name
    Surname
    Surname45
   Glass
    Name
   Gas
    Name

But if you gona have only 1 folder in each, defenetly use My_SuperCoolClassName structure not to make your head blow trying to get to file which is LAST in the chain and not to make your Kohana expand every folder while searching required files on loading.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top