Skip to content

Nutt.net Posts

Benchmarking PHP: Is it possible to have too many comments?

PHP is an interpreted language; and as such, the computer needs to process the script each time it is run. Honestly, I don’t know much about the internal workings of PHP; so I don’t know how it handles comments in the code. More specifically, I don’t know how well it handles comments.

I have seen sites over the web going back and forth on whether it’s possible to have too many comments. Most I found said that it didn’t really matter; a few said it slowed execution. As I tend to be the type to over comment my code, I decided to test it for myself with some over the top commented code.