Hi all,
Although we have chosen PEAR coding standards[1] as the coding standard for phpMyAdmin[2], there are quite a number of occasions where the standard is being violated, especially the line length recommendation. For example in display_tbl.lib.php I can see lines with 282 character while the recommended limit is 75-85[3].
However, I feel that this limit is bit too restrictive given that some lines have indentation of about 32 spaces. So I think it's better to set the limit bit leniently (at least for those files) and adhering to it rather than ignoring the line length limit altogether. Any thoughts?
With things clarified all the GSoCers would be able to produce quality code during this summer.
On Fri, May 6, 2011 at 8:37 AM, Madhura Jayaratne madhura.cj@gmail.com wrote:
Hi all, Although we have chosen PEAR coding standards[1] as the coding standard for phpMyAdmin[2], there are quite a number of occasions where the standard is being violated, especially the line length recommendation. For example in display_tbl.lib.php I can see lines with 282 character while the recommended limit is 75-85[3]. However, I feel that this limit is bit too restrictive given that some lines have indentation of about 32 spaces. So I think it's better to set the limit bit leniently (at least for those files) and adhering to it rather than ignoring the line length limit altogether. Any thoughts? With things clarified all the GSoCers would be able to produce quality code during this summer.
Indentation probably doesn't count to the line length :) Nonetheless, there's indeed many places in pma that violates this guideline. I think it also depends on the type of code; as long as the crucial parts are kept short, it should be fine. Things like html output or language strings don't need to be short in order to be readable, imo.
-- Thanks and Regards, Madhura Jayaratne
[1] http://pear.php.net/manual/en/standards.php [2] http://wiki.phpmyadmin.net/pma/Coding_guidelines [3] http://pear.php.net/manual/en/standards.indenting.php
WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ Phpmyadmin-devel mailing list Phpmyadmin-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
Le 2011-05-06 05:20, Tyron Madlener a écrit :
On Fri, May 6, 2011 at 8:37 AM, Madhura Jayaratne madhura.cj@gmail.com wrote:
Hi all, Although we have chosen PEAR coding standards[1] as the coding standard for phpMyAdmin[2], there are quite a number of occasions where the standard is being violated, especially the line length recommendation. For example in display_tbl.lib.php I can see lines with 282 character while the recommended limit is 75-85[3]. However, I feel that this limit is bit too restrictive given that some lines have indentation of about 32 spaces. So I think it's better to set the limit bit leniently (at least for those files) and adhering to it rather than ignoring the line length limit altogether. Any thoughts? With things clarified all the GSoCers would be able to produce quality code during this summer.
Indentation probably doesn't count to the line length :) Nonetheless, there's indeed many places in pma that violates this guideline. I think it also depends on the type of code; as long as the crucial parts are kept short, it should be fine. Things like html output or language strings don't need to be short in order to be readable, imo.
I agree that we should tend to respect the standard more and I agree with the exceptions given by Tyron.
About HTML output, let's be proactive into refactoring this whenever possible.
Hi
Dne Fri, 6 May 2011 12:07:54 +0530 Madhura Jayaratne madhura.cj@gmail.com napsal(a):
Although we have chosen PEAR coding standards[1] as the coding standard for phpMyAdmin[2], there are quite a number of occasions where the standard is being violated, especially the line length recommendation. For example in display_tbl.lib.php I can see lines with 282 character while the recommended limit is 75-85[3].
Indeed having that long lines is indeed bad. However I don't feel like we should strictly limit to 80 chars, because sometimes the code is much more readable with single slightly longer line (let's say 100 chars) than splitting it up.
However, I feel that this limit is bit too restrictive given that some lines have indentation of about 32 spaces. So I think it's better to set the limit bit leniently (at least for those files) and adhering to it rather than ignoring the line length limit altogether. Any thoughts?
The big indentation usually shows that code should be split to smaller functional parts and avoid to much of nesting directly in place.