Re: Function size

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

 



Tedd Sperling <tedd@xxxxxxxxxxxx> writes:

> It would be an interesting survey to ask programmers to review their code and
> provide the average number of lines in their functions AND how many lines of
> code their monitor's can display. In other words, look at your editor; count the
> number of lines your monitor can display; estimate the number of lines in your
> average function; and report the findings.  For example, mine is about half --
> my monitor can display 55 lines of code and my average function is around 25
> lines. YMMV.
>
> Interesting, yes?
>
> Cheers,
>
> tedd
>
>
> _____________________
> tedd.sperling@xxxxxxxxx
> http://sperling.com

My monitor can also display about 55 lines of code, my functions are, on
average, just a few lines of code though -- a maximum of about 20, with
an average of around 5 or so.

This is because the rule of thumb I follow is that a function should do
one thing, and should be named well. The biggest downside to the type of
style I have is that if not done "correctly", people can feel like
they're swimming in a sea of chasing down functions to find out wtf is
going on. When done "correctly", it leads to pretty clear code, IMO.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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