incubator-zeta-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jerome Renard <jerome.ren...@gmail.com>
Subject [zeta-dev] Naming convention : *List variables
Date Mon, 07 Mar 2011 18:00:19 GMT
Hi there,

I would propose a small addition to the naming conventions.

A list of recommended names is already provided in
http://incubator.apache.org/zetacomponents/community/implementation.html#general-guidelines
however there is nothing proposed for variables like arrays.

As an example you can compare the two following snippets

Without "List" variable:
$rows = fetchSomeRows();
foreach($rows as row)
    [....]

With "List' variable:
$rowList = fetchSomeRows();
foreach($rowList as $row)
    [....]

The rationale for such variable names is that adds a bit more
semantics on what the variable
is supposed to contains. It should also help to avoid typos which
makes debugging harder.

What do you think ?

:)

--
Jérôme Renard
http://39web.fr | http://jrenard.info | http://twitter.com/jeromerenard

Mime
View raw message