From: Karsten D. <k.d...@fi...> - 2001-03-29 18:39:50
|
On Tue, Mar 27, 2001 at 08:03:20PM +0200, Alain Fontaine wrote: > * Use underscores in function names > Why ? If ever phpWebSite will be developed in an OO approach, why not use > the "java style" of function and variable naming ? setThisThat(), > getThisThat(), displayStuff() etc look much better to me than > set_this_that() and so on :) Well, I think we will stick with the underscores. See some other emails for some reasons. Basically: PHP does it this way (mysql_query, etc.), so we do it as well. This just isn't Java :-) And most of the code is written that way already. > *Try to avoid unnecessary file unclusions (see config.php and mainfile.ph= p) > This is of course always true, as an unnecessary file inclusion is always= to > be avoided per definition :). However, using include_once() and > require_once() could help avoiding problems a bit. True, *_once() should help. But we should nevertheless try to remove as many of these calls as possible, I think. > For the rest, I think the documentation and guidelines you put up will be > invaluable to the development team - good work. Thanks! I hope some more people looked at the suggested coding style and all agree to it. There is one more thing: I wrote "using tabwidth 8" which is (IMHO) the emacs default setting and preferred by K&R and the linux core hackers and many more. Do all agree on that? And what about the curly braces thing? Do we really put them on an otherwise empty line? I wrote that because I had the impression it was done that way in the code until now. I prefer putting the opening one last on the line, and the closing one first, as follows: foo() { bla } What do you think about that? (See /usr/src/linux/Documentation/CodingStyle if available on your computer for some even more detailed piece about coding style :-) Did anybody ever try to use GNU indent on PHP source code? Does that work? Regards, Karsten --=20 fishfarm - Karsten Dambekalns Echternstr. 73 - 38100 Braunschweig Tel. +49 531 1232902 mailto:k.d...@fi... Fax. +49 531 1232906 http://www.fishfarm.de/ ----------------------------------------------------- |