[Tutor] Dynamically naming functions

Ed Singleton singletoned at gmail.com
Tue Mar 14 10:50:00 CET 2006

On 13/03/06, Alan Gauld <alan.gauld at freenet.co.uk> wrote:
> > For website, I can't really see how I can not have a dynamic
> > structure.  There's no way I'm writing a function for each "folder".
> Hmm, this may be a CherryPie concept thing but the vast majority
> of websites do not have dynamic structures. It really shouldn't be
> necessary. Why would you need to write a function per folder,
> simply write one function that takes the folder as an argument.
> > I do take your point though, however you often find that it's easy to
> > maintain something dynamic than huge amounts of more static stuff
> Very rarely, its easy to do backups of huge amounts of data if you
> know where to find it, its hard to trawl all over a changing structure
> looking for the things that need backing up. Particularly if, when you
> try to restore it, it needs to go in a different place to where you found
> it!

Backing up is generally one of the lesser of my worries.  Maintaining
content is primary.  Unless you are dynamically generating static
pages, they are a nightmare to maintain.  Particularly as it tends to
be quite repetitive.  A large amount of the code on any page is the
same as on any other page (page structure, boilerplate, etc).

I think it's a generally accepted principle that computers are better
at handling thousands of files like that better than humans are.  The
more of the repetitive stuff that can be removed and given to a
computer, the better.

> > in the difference between hundreds of static web pages and using
> > a cms of some kind).
> Yes but a CMS normally uses a static structure with dynamic content.
> The templates stored in one place and the content in another. The
> templates know where to look for the content and the content doesn't
> care where the templates are.

I think we might be using different meanings of structure.  I'm
referring to the site structure, as in which page is a parent of which
other page.  The site structure is just another aspect of the content.
 A reference to the parent/child pages is just another attribute like
content and title.

A (good) CMS would create a dynamic structure for the user to browse,
with folders and pages easily creatable and movable, and references to
pages would be dynamic so that if yo0u move a page internal links to
it still work.

> Dynamic content is 'A Good Thing', dynamic structure is usually bad.

But structure is just an aspect of content.

> BTW On the concept of loading your entire site at startup; if you are
> sharing a server you will make yourself very unpopular since you will
> be a huge resource hog. That's why ASP, JSP and other frameworks
> go to a lot of trouble to manage session lengths etc - to free up any
> unused resources and keep server speed up. Loading the structure
> of the site in the form of links might be reasonable, but only load content
> when you absolutely must. This also helps the maintainers update the
> site without restarting it.

I have my own dedicated server, but point taken.  Though I will still
need to reload the structure of the site when the maintainers change
it (adding/removing pages etc).


More information about the Tutor mailing list