[Israel.pm] variable name style (was swap arrays)

Yosef Meller mellerf at netvision.net.il
Tue Feb 17 02:53:23 PST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Yossi.Itzkovich at ecitele.com wrote:
| Hi,
|
| Yosef Meller  wrote:
|
| "Caviat: if you have two different variables of the same name (like
| $count, @count), which is bad programming style anyway, you'll end up
|  swapping it too."
|
| what's bad in this style ?
|

Well, except for minor cases, having two variables of the same name can
be very confusing and spoils readability, just like having two variables
with same name but different capitalization. This isn't Visual Basic,
you know...

- --
perl -e'$b=unpack"b*",pack"H*","59dfce2d6b1664d3b26cd9969503";
for(;$a<length$b;$a+=9){print+pack"b8",substr$b,$a,8;}'

My public key:
http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x3D2CA0A8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAMfKjaElZPz0soKgRAvphAKCLCNb9xUTERbioTNW1UFtiZ5hXpACfRjw9
bS7tWIF4ODXGxiZLKuFMn20=
=iiqS
-----END PGP SIGNATURE-----



More information about the Perl mailing list