Jump to content

Appropriate use of function declarations


sunwukung

Recommended Posts

Hi all,

this is not so much a technical problem as a design choice. We're having a discussion at work to consolidate disparate coding methods. In general, the PEAR and Zend standards documentation has provided suitable material for defining common practice goals. However, I wanted to ask your opinion about function declarations:

 

Q: Should you declare functions for code that is only used once on a given page request?

 

My feeling is that this is an incorrect use of functions, incurs an unnecessary (perhaps negligible) overhead.

I guess you could also ask a similair question about objects - i.e:

 

Q: At what point is a body of code eligible/ineligible for object construction?

 

What are your thoughts?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.