[Pmwiki-users] thoughts on customization sequence in pmwiki 2 ...

Robert P. J. Day rpjday
Mon Oct 18 09:08:10 CDT 2004


On Mon, 18 Oct 2004, Patrick R. Michaud wrote:

> On Mon, Oct 18, 2004 at 07:50:23AM -0400, Robert P. J. Day wrote:

> > unless all these names have been absolutely cast in stone (and they
> > may very well be), i *implore* you to change them to more meaningful
> > and relevant names.  as options, the current group and page name might
> > be represented by
> >   $CurrentGroup
> >   $CurrentPage
>
> These are too long--variables that are used frequently (and $Group and
> $Name are by far the most commonly used items in templates) should
> be short and easy to remember.  Also, $CurrentPage itself would be
> confusing -- does it refer to just the name component of the page or
> the page's full name?  I'm very likely to leave $Name and $Group as
> they are, although I might switch to $FullPageName instead of $PageName.

the programming law of orthogonality suggests that you should have two
variables:

  $Group	JUST the group name
  $Page		JUST the page name

and if any code needs the full page name, it can construct it quickly
enough by concatenation.  as long as those two pieces of data are
universally available, any code can build the full page name if it
needs it.

rday

p.s.  in other words, for simplicity, there is *no* need to have a
FullPageName variable or PageName variable hanging around at all
times.  that's just cluttering up the namespace.



More information about the pmwiki-users mailing list