Results 1 to 3 of 3

Thread: What is processed and when?

  1. #1
    Join Date
    Jan 2010

    What is processed and when?

    I am in the process of writing a CMS as an intellectual exercise and to progress my skills, however there is one question I have never seen a definitive answer to.

    Say I want to use a function to generate a loop of results and output the appropriate data on my front end page, should I declare the function on the actual page, or can it go into a master functions page?

    Or put another way if I create a large functions file with a load of useful functions in it, does having a 1000 functions file slow down the load of a page if none of the declared functions are called?

    Thanx in advance

  2. #2
    Join Date
    Aug 2004
    Does it slow it down? Yes. Is it enough to worry about? That depends on lots of variables.

    You can split the difference and combine groups of related functions into files, and only include those files you actually need.

    You could take the next step, and enter into the world of object-oriented programming, where things that belong together become class definitions. With some clever use of naming conventions and auto-loading, you automatically only load those classes that you use.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Jan 2010
    Thanks a lot, I want to start playing around with object orientated php but there is only so much time you can get to work on things

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center