[Phpmyadmin-devel] Naming convention standard for methods
pe.chanaka.ck at gmail.com
Sat May 12 06:51:23 CEST 2012
While I'm refactoring some files relating to display query results
(currently display_tbl.lib.php, common.lib.php), I can method names are
used regardless of the inside functionality.
Ex :- "PMA_displayHtmlRadio" in common.lib.php method return a string of
But the name tells the function displays HTML itself.
As I feel these things should be modified.
As library files, they never should render HTML inside the functions
Better thing is to return a string of PHP having the HTML content.
So my suggestion is to use the phrase "get" for the every method which
return any data type.
So that developer can understand it returns something just looking at the
Following are some suggested names. (Some of them are already discussed in
this mailing list)
PMA_displayHtmlRadio -> PMA_getRadioFields
PMA_generateSliderEffect -> PMA_getDivForSliderEffect
PMA_generateHtmlDropdown -> PMA_getDropdown
PMA_displayTableNavigationButton -> getTableNavigationButton
(All above functions return strings)
Hope to join a discussion on this.
Bsc.Computer Engineering Undergraduate
Faculty of Engineering
University of Peradeniya
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Developers