variable naming convention question - from 1.7 General Style and Syntax guide |
[eluser]skattabrain[/eluser]
First of all ... /CodeIgniter/user_guide/general/styleguide.html is a great addition to the documentation. But I have a question ... Quote:Variable Names Is using a single letter for things outside loops bad for the reason of not being obvious as to what the variable is? Or is there another reason?
[eluser]xwero[/eluser]
That is the main reason indeed. Code is a way of communicating with other programmers so you should write code others understand.
[eluser]thomas.ernest[/eluser]
I've developed something [ci4php-cs] so that PHP_CodeSniffer [phpcs] support Code Igniter style guide [ci-style]. It is able to check variable naming: names longer than 3 chars except in for loops. Feel free to give a try and share your feedbacks. [phpcs] http://pear.php.net/package/PHP_CodeSniffer/ [ci-style] http://ellislab.com/codeigniter/user-gui...guide.html [ci4php-cs] https://github.com/thomas-ernest/CodeIgn...odeSniffer |
Welcome Guest, Not a member yet? Register Sign In |