From zeta-dev-return-600-apmail-incubator-zeta-dev-archive=incubator.apache.org@incubator.apache.org Tue Mar 08 10:32:28 2011 Return-Path: Delivered-To: apmail-incubator-zeta-dev-archive@minotaur.apache.org Received: (qmail 69802 invoked from network); 8 Mar 2011 10:32:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Mar 2011 10:32:28 -0000 Received: (qmail 36633 invoked by uid 500); 8 Mar 2011 10:32:27 -0000 Delivered-To: apmail-incubator-zeta-dev-archive@incubator.apache.org Received: (qmail 36605 invoked by uid 500); 8 Mar 2011 10:32:27 -0000 Mailing-List: contact zeta-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: zeta-dev@incubator.apache.org Delivered-To: mailing list zeta-dev@incubator.apache.org Received: (qmail 36597 invoked by uid 99); 8 Mar 2011 10:32:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 10:32:27 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of maxime.thom@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-ww0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 10:32:21 +0000 Received: by wwb17 with SMTP id 17so741825wwb.0 for ; Tue, 08 Mar 2011 02:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=miZiPaeNO0htB0JJ9/3x7/fv06GBRJnnt09A7bxpJmk=; b=g52SYeXxKeqMGX2m1yD3+Y8JK/Jze9rGN0/tkNFd2hRjjEX0xqWG6e1CvtR+jZuvXm o9w3CA9DDktSKtjzXvTE/oh9/Cu7UhiWyKXp9BQYYdMIpHxOn7XT7S60UTRYi2dsvEa+ GKIo+zRKrOPczHyL8JsdYVPqCrbgMOPVPfTV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=HkzPNG4xkvIdAtKvS9dJpFLw4aJ14OQGqrhOdPHaTnfHtqvSVrlY+B/1lEuQMVKa4y 0nb9aiY9pEPG+UJRoTw0In33LMNr/OGwcRekA+0dtZQYRe5D3ew2+6Nlmi1I4DSn7MSF LiQYAXnM/yWp1A8JLYlqSbuW/p34ybdLkV/jc= MIME-Version: 1.0 Received: by 10.216.140.154 with SMTP id e26mr4160523wej.79.1299580320546; Tue, 08 Mar 2011 02:32:00 -0800 (PST) Received: by 10.216.121.144 with HTTP; Tue, 8 Mar 2011 02:32:00 -0800 (PST) In-Reply-To: References: Date: Tue, 8 Mar 2011 11:32:00 +0100 Message-ID: From: Maxime Thomas To: zeta-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=0016e6d7eed05d0102049df61f21 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [zeta-dev] Naming convention : *List variables --0016e6d7eed05d0102049df61f21 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 2011/3/7 Jerome Renard > Derick, Patrick, > > On Mon, Mar 7, 2011 at 7:09 PM, Patrick ALLAERT > wrote: > > 2011/3/7 Jerome Renard : > [...] > > > > There is nothing wrong being explicit about the content of the > > variable, but I would refrain from using types like "Array", "List", > > "Integer",... > > Maybe I have not been clear enough. > > The point is not to name a variable acording to its type for ints, > floats etc, etc. > > The point is to provide a visual/semantic help for arrays (or > hastables) *only* by suffixing them. > Using a variable in its plural form might not be ideal for some > people, this is what I am > trying to adress with this idea, which maybe is a stupid one. > > The rest (int and others) remains unchanged. > > :) > > -- > J=E9r=F4me Renard > http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard > Ok, so if I understand it well : you put List after variables that you will use in foreach. Do we put other variables types in foreach than arrays ? For the name rules for variables, I personnaly used the "_id" suffix to semantically design a integer variable, the "s" suffix for lists (it could be also more gramatically based rules : child / children) and by default vars are strings. For small treatments, not meaningful, I prefer to use "anonymous" variable names like $i, $j, $k, $v... It could be for example, a generic function that processes an array. --=20 Maxime maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou --0016e6d7eed05d0102049df61f21--