Re: simpletest vs phpunit vs ... [message #180496 is a reply to message #180491] |
Fri, 22 February 2013 12:06 |
Simon
Messages: 29 Registered: February 2011
Karma:
|
Junior Member |
|
|
On 2013/02/22 12:49 PM, Tim Streater wrote:>>
>> I've been paid to write software for 35 years.
I have only been doing it for +15 years...
>>
>> >The rule of 'more lines of comment than code' holds...
>>
>> IMO, unless you are citing sources for complex scientific computation,
>> or algorithms from a referenced source (i.e. "I took this from Knuth,
>> Art of Computer Programming, Volume II, pg. 235"), the need for
>> comments indicates that your code isn't clear enough to begin with.
>
> That code might be clear now, but wait a few months. Or get the view of
> the poor bugger who is now *maintaining* your code.
>
I tend to take the middle ground approach.
Good function/variable names usually go a long way to make the code clear.
I also tend to limit the length of my functions, the shorter the better.
I add comments as much as possible, but I don't write an essay
explaining why I took the approach I did.
Well written code should speak for itself, even many months later.
Simon
|
|
|