Re: Useful Function Names

Mike Gifford <[email protected]> Mon, 20 Oct 2003 14:27:54 -0400
Newsgroups gmane.comp.cms.phpslash.devel
Organization OpenConcept Consulting http://www.openconcept.ca
Message-ID <[email protected]>
Hi Joe,

On Sun, 2003-10-19 at 01:39, Joe Stewart wrote:
> On Sat, Oct 18, 2003 at 03:43:14PM -0400, Mike Gifford wrote:
> > It's hard to think of descriptive names some times.  You know what you
> > mean and what you want the function to do..  If you could do that it
> > would be great.  We'll certainly adopt it.
> been trying to use psl prefixes of late.

Some of our functions have be prefixes, but it isn't consistent.

> > > > Also in class/slashPerm.class:have_perm() - If single letter variable
> > > > names could be avoided or at least commented that would be good. 
> > > > Realize this is just a modified version of phplib, but it's always
> > > > easier to understand the code when it is written in human. 
> > > If it's just the $i integer increments, I'm not too worried about this.  This has been programming convention for a long time.
> > There are some $j's in there too..  I'm not all that concerned with
> > it..  Teh $i, $ii & $iii, $v, $k conventions are pretty normal.  Wasn't
> > sure what $j was referring to though.
> old fortran guy.  j is another integer increment.

Ok..

> I see the code in question.  Yes, it needs documenting and rewriting.  k
> and v are the key and value.

Yup..  Also pretty common..  But confusing if you aren't familiar with
the convention.

In anycase, something else for the todo :)

> > > As far as foreach loops instead of for loops.  This has been done as code
> > > is worked on and was one of the design goals. 
> > Yup.  Damn, I was hoping that http://www.phpslash.org was back up so I
> > could look at your developers guide so I could just refer folks there
> > (as we've done in the past).
> http://phpslash.sourceforge.net
> This is why I don't use the rooturl.  Both domains served with one setup.

Yup..  good to know it's there..  Pain about the .org though..

> > > Also don't use:
> > > for ($i = '0' ; $i < count($allSections_ary) ; $i++) {
> > > since the count function is call for each loop.  Instead calculate the
> > > count before the loop.
> > Interesting..  I didn't realize that..  That might be worth going back
> > and cleaning up to boost performance.
> I haven't noticed it actually helping significantly.  But better practice.

Good to know..
...
> > Yeah..  I figured that there must be a trade off for adding in the extra
> > code/variables...  I do think it is easier for folks who are used to
> > having the warnings/notices enabled to have an environment that isn't
> > flooded with harmless ones..  I've had a couple folks complain about it
> > this year.  
> Anybody getting them with 0.7.2, either submit a bug or patch please.

We've got to move over the rest of BE's code to 0.7.2..  It's still a
time consuming process though.

Mike
-- 
Mike Gifford, OpenConcept Consulting
Free Software for Social Change -> http://www.openconcept.ca
Beads of Hope Campaign - http://uc.openconcept.ca/petition.php
Nonconformity is the highest evolutionary attainment of social animals -
Aldo Leopold




-------------------------------------------------------
This SF.net email sponsored by: Enterprise Linux Forum Conference & Expo
The Event For Linux Datacenter Solutions & Strategies in The Enterprise 
Linux in the Boardroom; in the Front Office; & in the Server Room 
http://www.enterpriselinuxforum.com