[thelist] Do comments cause hit on system?

John williams thudfactor at gmail.com
Mon Feb 7 08:33:24 CST 2005

Technically, yes. CSS and HTML comments are delivered to the end-user,
so there's a bandwidth hit. But unless your comments are a significant
part of your code, I don't think there's anything to worry about.
Especially in your situation the sacrifice of comments would be too
great for the almost certainly miniscule speed increase.

And comments in PHP code are never delivered to the browser, so
there's not even any bandwidth hit.

Considering the value of comments in development and maintainability
and their insanely low processor/bandwidth overhead, there are many
other things to worry about hogging system resources before you start
worrying about comments. Are your images well optimized? Are you using
CSS instead of tables for layout? Are you calculating the size of an
array before looping through it? And so forth.

On Mon, 7 Feb 2005 08:46:51 -0500, Fred D Yocum <fdy at mcc.org> wrote:
> I work in an organization where Web sites are developed by a team that is
> geographically distant. This increases the importance of commenting code,
> HTML, CSS, PHP. Does commenting cause a hit in the browser or on the
> server?  Specifically, does the browser or server need to 'think' about
> comments?

More information about the thelist mailing list