Re: What design patterns do you usually use?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 27, 2008 at 2:17 PM, tedd <tedd.sperling@xxxxxxxxx> wrote:

> At 12:45 PM -0500 2/27/08, Nathan Nobbe wrote:
> >if i were going to design a system consisting largely of functions, i
> would
> >use the same practice i use for designing classes; each function would be
> >concise.  that is, if functions became large, eg over 20 - 30 lines
>
> One of the things I've noticed over the span of decades is that my
> functions have gotten larger as my monitor size has.
>
> This has lead me to conclude that function size is really dependant
> upon what you can "take-in" in at one time.
>
> Fortunately/unfortunately, my eyesight is failing as my monitor size
> increases so I'm at a static size now for functions, usually not
> exceeding 20-30 lines.
>
> Maybe the younger ones will remember this as they age and see if this
> holds true for them.


for me it has nothing to do w/ monitor size.  large functions generally
equate to one thing; they do more than one thing.  which is a problem.
i hate running across do-it-all functions, because they simply arent
extensible.  unless of course you dont mind tossing more conditionals
in there, and growing it even more, thereby adding more bloat and
obscuring the original purpose of the function even further.  im faced
w/ this sort of code as i maintain a nasty hacked mess almost every
day for sometime now. *sigh*
but seriously, i like to keep my functions to the point.  whether they
are in classes or not.  theres even a formal software engineering
concept about it, separation of concerns;
http://en.wikipedia.org/wiki/Separation_of_concerns

-nathan

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux