[eluser]Watermark Studios[/eluser]
Great learning path...and so true...RT(F)M!
[eluser]alejandronanez[/eluser]
That's a really good POST! Damn I LOVE IT!
Great Job Buddy!
[eluser]Buso[/eluser]
Thanks a lot
My personal best practices (you can take em or leave em =P):
_Write everything in camelCase when possible
_Always set up a main controller in the libraries directory, from which all your other controllers extends.
_Everything that can be output, make it a view. Eg: error messages.
_JS files in /js. Call them through a view.
_Always follow the same naming pattern, like getComments, getSomething. Wrong: findComments, fetchSomething, giveMeTheStuff.
_I can say the same about database tables and columns. If the primary key is the table's id, name it just id. If it has-a-thing, make a column named thingId, or thing_id. But stick to the one you choose.
_Try to make your methods for general purpose reusable when possible.
_Never hardcode. Make a custom config file and use it (it's clear in the userguide)
_Avoid using include/require. Only use it to add functionality to your codeigniter, but do it inside a library.
If something else comes to my mind ill write it later
[eluser]jovaniwayne[/eluser]
Thanks for this post. Very straight forward.
[eluser]Unknown[/eluser]
Useful post I like this. thanks
[eluser]Jelmer[/eluser]
Thanks for all the compliments.
I changed the bit about Auth libraries a bit last week as the link it refers to has gotten a bit old.
I'll add something about ORM's this weekend as that's something people ask about often as well.
@Buso,
While I would agree with many of your points, I tried to write this without anything (or at least very little) that could be considered a personal opinion rather than a best practice.
That being said, I might put something in there on your points of making things as general use as possible (DRY), on using consistant naming (although I won't put a preference on either camilcase or underscores) and on using the language and config libraries.
[eluser]physicsdave[/eluser]
Lists like this are extremely valuable. If they didn't exist it would take a lot longer to acquire the info from random forum posts, stumbling around on Wikipedia, etc. As someone who discovered all of the information by stumbling randomly around online, I am grateful to see lists like this posted. Great starting point & awesome info!
Thanks!