2011/3/7 Jerome Renard <jerome.ren...@gmail.com>

> Derick, Patrick,
>
> On Mon, Mar 7, 2011 at 7:09 PM, Patrick ALLAERT
> <patrick.alla...@gmail.com> wrote:
> > 2011/3/7 Jerome Renard <jerome.ren...@gmail.com>:
> [...]
> >
> > 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érôme 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.

-- 
Maxime
maxime.tho...@wascou.org | www.wascou.org | http://twitter.com/wascou

Reply via email to