On Tue, 13 Feb 2001 16:48:10 -0500, Sam Leibowitz
([EMAIL PROTECTED]) wrote:
>My personal opinions:
>
>The effect of comments in code parsing speed is negligable. Never
>hesitate
>to put in a comment because you think it's going to slow down the
>procedure.
>If your speed requirements were that down to the wire, you should
>have gone
>with a compiled app anyway. Or a faster server.  Or anything other
>than not
>putting in comments.
>
>That said, it's rare that I've written 2 lines of comments for every
>1 line
>of code, and I tend to be fairly rigorous (on good days, anyway)
>about
>commenting completely.  You may want to consider putting some of
>those
>comments in seperate design documentation.
>
>Finally, I tend to break up my source code into several files,
>usually
>around the class definitions (I like object orientation).  I usually
>wind up
>with one file for the database interface, a few files containing
>class
>definitions corresponding to the business logic, and an included
>fragment
>for each block of HTML which needs to interact heavily with the PHP
>(for
>example, pre-populated form fields).  This is purely for
>ease-of-maintenance.
>
>Where you can, you should replace calls to include() with calls to
>require(), because require() is a bit faster.  The catch is that you
>can't
>place require() calls in conditional blocks, so:
>
> if ($something) include($foo); // this is okay
> if ($something) require($bar); // this is not.

if ($something) { include($foo); } // this is okay
if ($something) include($foo); // this is not.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to