From: Christian Neukirchen Date: 2006-05-10T01:56:20+09:00 Subject: Re: Method Size - Best Practices Pistos Christou writes: > Eric Hodel wrote: >> My unit tests typically tell me which line my errors are on. You >> probably haven't written enough tests for your code or aren't writing >> small enough chunks of code. >> >> The biggest change writing tests has done for my coding is to give me >> smaller more descriptive methods rather than large methods that do >> too much. A method that is more than 10 lines long is probably >> wrong. A method that is more than 25 is most definitely wrong. > > Poll (for everyone, not just Eric): What is good or acceptable method > size in your opinion? On what factors does your range depend? "I tend to break up a subprogram when there are too many local variables. Another clue is [too many] levels of indentation. I rarely look at length." --- Ken Thompson, http://damienkatz.net/2006/05/signs_youre_a_c.html#comments (via http://feeds.feedburner.com/projectionist?m=710) > Pistos -- Christian Neukirchen http://chneukirchen.org