From: Simen Date: 2006-05-10T04:04:14+09:00 Subject: Re: Method Size - Best Practices Eric Hodel wrote: > On May 9, 2006, at 7:04 AM, Pistos Christou wrote: > >> Poll (for everyone, not just Eric): What is good or acceptable method >> size in your opinion? On what factors does your range depend? > > A good and acceptable method size should be almost entirely based on > comfort. Trying to artificially constrain yourself is only going to > lead to bad code (and stress). > > My coding style (with TDD) leads to 10 to 25 line methods because > those are most comfortable. Exactly. Break everything down into comfertable units, but not any smaller. If a method does one thing and does it well, and there are no patterns inside it that are common in your code, there is no use in dividing it further into more methods. That being said, if you have methods that are 50+ lines of code, those should be the first to look for potential refactoring in. -- Posted via http://www.ruby-forum.com/.