[eluser]jedd[/eluser]
[quote author="newbietoprofessional" date="1237777175"]
I would like to tell you about an experience I had with Code Igniter and CamelCase naming. I had a major problem the other day when I was deploying a re-structured version of my website using Code Igniter. My site was unavailable for 30mins while I tried to sort out what the cause of the error messages was.
[/quote]
Hi Newbie - it's often good to have a staging site. Say on your local computer. Where you can test things like production releases, before releasing them into production. VMware, or VirtualBox, are two good options to look at.
Quote:I finally discovered that CodeIgniter wasn't happy with the CamelCase naming I had used for the filenames of my models.
Hmm. If only you'd read the manual first, you could have saved yourself a lot of grief! The phrase -
[url="http://ellislab.com/codeigniter/user-guide/general/models.html#anatomy"]The file name will be a lower case version of your class name[/url] - lacks ambiguity.
Quote:This resulted in me having to change the filenames to all lowercase and make the changes in over 100 places where I had referenced those classes.
I don't see why your class names would have changed. They can be anything you like, though of course the manual does make it clear they
should be first-letter-upper, and the rest lower. Did you actually try changing the half dozen filenames first, because I think that should have been sufficient.
Quote:What I would like to know is why Code Igniter has such tight restrictions when it comes to file naming and prefers to see practically everything in lowercase?? Beats me.
Now that
is a good question. My gut feel is so that on real operating systems (I gather you develop on a pretend operating system and run your production on a real one, yes?) where case is respected and relevant, it's measurably faster to hit a file by name, rather than by searching for it in a directory. If you make an arbitrary rule - in this case that the filename is always lower case - then it's very easy to algorithmically identify what the filename of a given class name will be - you just strtolower() the thing and you've got it.
If you let people do whatever they like with filenames, you're introducing a) more complexity into the code as it has to handle permutations, b) a greater cost to the 'find this file and load it' function, and consequently c) a reduction in performance.
That's my guess, but there may be other reasons.