Re: Mixing OO and DB
Date: Sat, 8 Mar 2008 16:32:43 -0600
On 2008-03-06 16:05:47 -0600, Gene Wirchenko <genew_at_ocis.net> said:
>> A function should be no longer than five or ten lines of code. This is
>> about as obvious and self-evident as it can be. Are you really going
>> to argue that functions should be longer?
> Hmm. It used to be a page. Attention spans are getting shorter?
It used to be: "No longer than a screenful". Average size would be considerably less. That rule was invented when a "screenful" was the number of lines on a VT100 -- 24. And four of them were used by the editor for administrative purposes. So, 20 lines as a maximum.
> Of course I am going to argue against such ridiculously low
> limits. Some functions are longer. Splitting them up into small
> pieces can make them much harder to follow.
> I have had cases of snippets, that if I were to convert them to
> functions, what with all of the context that I would have to pass and
> handle, that the calling sequence (setup, call, wrapup) could be
> longer than the snippet. That way lies madness.
-- Robert C. Martin (Uncle Bob) | email: unclebob_at_objectmentor.com Object Mentor Inc. | blog: www.butunclebob.com The Agile Transition Experts | web: www.objectmentor.com 800-338-6716 |Received on Sat Mar 08 2008 - 23:32:43 CET