Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Useful Function Names: msg#00019

cms.phpslash.devel

Subject: Re: Useful Function Names

Howdy Joe,

On Fri, 2003-10-17 at 10:17, Joe Stewart wrote:
> On Thu, Oct 16, 2003 at 09:23:50AM -0400, Mike Gifford wrote:
> > One of our developers wasn't too keen on the function names "clean" and
> > "dirty" in class/functions.inc
> > In a future release could these be extended so that they are more
> > descriptive? cleanUserHTML perhaps? He'd just like to have as much
> > meaning built into it as possible.
> yes. I saw a note about name collision with getHeader in the BE cvs too.

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.

> > 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.

> 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).

> 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.

> But in general, move to foreach as development continues. One thing this
> can do is generate more warnings instead of less in at least one instance.

Good..

> Also getting rid of the warnings by defining variables before their use
> definitely slows down the code measurably. But I have found a few bugs in
> the code fixing.

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.

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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation