LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[Webdev] Learning PHP

[Webdev] Learning PHP

Philip Reynolds phil at Redbrick.DCU.IE
Thu Dec 19 18:08:30 GMT 2002


Russell Matbouli's [russell at futureless.org] 33 lines of wisdom included:
> Some good advice I once received - if your subroutines are more than
> about 10 lines, they're too long. Short amounts of code are much easier
> to read. Also, try to remove as many variables as is possible. It makes
> it easier to read too. If you can read the code, you're more likely to
> understand it and remember what you were thinking when you wrote it :)
> Don't be afraid to create lots of packages/modules/classes with not a
> lot in them if it helps to keep things separate and logical to you.

This advice stems from Objected Orientated Software Metrics. One of
the metrics is of course size, of lines of code per functions.

It differs from language to language, obviously. You couldn't apply
the same metric to lines of code in a function in C++ that you would
in PERL or PHP.

One stigma, I've noticed with PHP programmers, whether it's through
lack of experience, is nearly NO code re-use at all. 

-- 
  Philip Reynolds        
   RFC Networks          tel: 01 8832063
www.rfc-networks.ie      fax: 01 8832041



More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell