Re: Normalized Numbers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2007-01-12 at 14:40 +0000, Roman Neuhauser wrote:
>
> I know it sounds crazy, but (most) comments are evil.  Comments are are
> excuses for better code, they're often no more than a vague repetition
> of what the code says. If the code doesn't describe what it's doing
> while it's doing it, then the code should be fixed.

Amen.

There are not that many cases were comments are actually useful.
Generally when necessary they give a brief summary of what is intended
or they clarify ambiguity or specialized techniques. Well chosen
variable and function names cause the code to practically comment
itself.

I think the discipline of using longer and more descriptive
variable/function/class names is far more helpful than commenting every
second line of code with the obvious.

> >  2    // check if th function was passed only a single character
> >  3    if(1==strlen($cd)) {

Ummm, DUH! :)

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux