Using CodeIgniter in a project
Posted by mkhairul - May 1, 2009 at 12:05:23 pm - No CommentsCategories: Tips, codeigniter
So you want to use CI for your project? There’s several ways to prevent spaghetti code and it depends on the situation.
At the beginning of a project
I would advise that the lead to tutor all the project developers on how to build an application with CI. While tutoring follow a coding guideline and write some documentation, so that when you demonstrate it to them while coding, you refer back and forth to the guideline/documentation and explain why this is done this way instead of the other way. This should also encourage the developers to refer to the guideline and docs.
After a week or so, the lessons should be able to sink in, and see the progress of the developers on their coding style whether it follows the guideline.
In the implementation phase, do some code reviews (this requires discipline) until everyone gets it. All tabs is 4 spaces and is converted to space character not a tab character. I don’t mind different IDEs but the spaces must be consistent. Its very hard to read the code if its not.
In the Middle or Near the End of a Project
Do lots of code reviews. At this point of time, you’d probably don’t have a lot of time to show how to build an application with CI, so explain briefly how the structure is formatted, how things are done and designed and code. After all the introduction are done with, do code reviews.
In the end..
I’ve seen lots of variables and array abuse that makes it very hard to read code and there’s no synopsis of what it does (comments). I too am guilty of this and I try to reduce it. Hopefully with this post I would remind myself in the future that spaghetti is delicious and all but try to keep it out of the code.
No Comments yet »
RSS feed for comments on this post. TrackBack URI
Leave a comment
GimpStyle Theme design by Horacio Bella.
