You are here: Re: [PHP] Re: Performance & Comments Question « PHP « IT news, forums, messages
Re: [PHP] Re: Performance & Comments Question

Posted by "Richard Lynch" on 01/19/06 23:18

On Thu, January 19, 2006 7:09 am, Jochem Maas wrote:
> Barry wrote:
>> Rodolfo Andrade wrote:
> and people will love you if you'r files are 90% comments :-)

Actually, the times I've seen THAT much commenting, it was generally a
lot of useless "noise" and I hated it...

Consider this common practice:

Function: foo
Purpose: foo the input string and return a string
Inputs: $string, the input string
Output: result string of foo
Author: Some I. Guy <>
Date: 4/1/2005
function foo($string){
//code I don't understand
return $result; // I got this part :-)

Note: The Author no longer works at Example, and his email address is
invalid, of course.

If you're going to comment, then comment on the high-level stuff of
what you are *DOING*, not the minutia I can read in the source in the
first place!

Oh yeah:
Comments with increased file size certainly matter, depending on the
disk block size, the OS cache size, PHP's cache sizes, the number of
times you foolishly 'include' them, the number of files you've broken
things into, etc...

You'd have to have a HELL of a lot of comments for that part to matter.

The PHP parser can't be working TOO hard to rip out comments -- It
doesn't even allow nested comments /* ... /* ... */ ... */ so it
only has to scan ahead for the character combination '*/' and that's
pretty fast.

If you are using an opcode cache, it becomes even more meaning less,
as noted.

You could almost for sure find a comment-stripper "out there" and
benchmark for yourself on your own hardware:

Like Music?



[Reply to this message]

Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация