RE: Normalized Numbers

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

 



hi...

haven't followed the entire thread.. just saw this portion that pertains to
comments....

i can only assume you guys are relatively young.. if you ever have to pick
up a piece of code that was developed 10 years ago, and you need to track
down/test/get back into production in a matter of a few days, then you had
better pray that the code was either 1) carefully used the variable
declarations in a matter that you understand, or 2) that the code has
copious comments at both the functional level as well as the line/section
level, and that the routines discussed the functions that use the routine,
as well as where the inputs are coming from, and going to...

there's a huge difference in dealing with something that runs a small
website, and something that controls a processing line, where if you screw
it up, you're going to cost $5K/hour when the code is screwing up!!!!

my $0.02 worth....

ps. keep in mind, one person's clear code declarations can be complete
garbage to another person, and you forget why in the hell you did something
over time... clear code comments are a way to (hopefully) make sense of what
the overall chunk of code is supposed to accomplish!!



-----Original Message-----
From: Brian P. Giroux [mailto:bpg@xxxxxxxxxx]
Sent: Sunday, January 14, 2007 8:30 AM
To: php-general@xxxxxxxxxxxxx
Subject: Re:  Normalized Numbers




Robert Cummings wrote:
> 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! :)

I guess some of the comments are a little obvious.

> Cheers,
> Rob.

--
Brian P. Giroux
Sénécal & Associé.e.s / Associates
Recherche et marketing / Research and marketing
Tél : (705) 476-9667
Fax : (705) 476-1618
www.senecal.ca

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

-- 
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