From: "Slawomir Pucia" <[EMAIL PROTECTED]> > > Can you add anything to our coding conventions > > discussion? > > First of all, I'm after PEAR coding standard in examples. However, there are > some elements which are not covered by PEAR docs:
First of all you should know, that the first writting of PHPDOC was only a rewrite of Rasmus´ PHP/FI manual. More and more authors and contributors asked many times for a coding standard. So there we included some in the source. After PEAR was born, Stig or other persons wrote another for PEAR. Both standards differ in many places. So I argue to stay with the current coding standards and improve that. > 1. Always use the same values for server, userneme, password and database > name, when connecting to database. The database "marliesle" was very helpful to detect plagiarism. > 2. Always use "or die(...)" in database examples. > 3. Use print 'foo' when foo doesn't need to be parsed. > 4. Use lowercase in HTML tags. > 5. Don't use "$query='...'; mysql_query($query)" when its not needed. > 6. Don't use a variable which in not set in example (see $user in > mysql_field_name example). > 7. Decide whether to use echo or print (and printf) for output. I preffer > echo. -Egon