Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Simon Newsgroups: comp.lang.php Subject: Re: simpletest vs phpunit vs ... Date: Fri, 22 Feb 2013 14:06:35 +0200 Lines: 28 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net AxjNgNfTFJgVUaVXZn6UngGqeh8DMvGBpyY+bueMfpvTk/6uTeM1vY2WjuA6L7Q0WM Cancel-Lock: sha1:rXFq4yneVz8RM/1AV+IjmyB4Q2M= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: Xref: csiph.com comp.lang.php:8430 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