A question of Style, was: SPUG: Sort an array question

Brian Hatch spug at ifokr.org
Fri Dec 27 14:14:04 CST 2002

> 	for my $Working ( 0 .. $#Array) {
> 	    for my $Compare ( $Working + 1 .. $#Array) {
> 		$Temp = $Array[$Compare] . $array[$Working];

Wait - one of the arrays is working, and the other is broken?

Although I'd argue $i and $j, I'd certainly pick $index1
and $index2 over something like working/compare where I'm
more confused by having variable names that don't indicate
what they are (indexes into an array) and that, in this
case, have alternative names that can remove any mnemonic

> I've changed the variables to initial caps, since it helps them stand out
> from all the lower case reserved words.  This is entirely individual
> preference.

Everyone has an angle on capitilization vs not.  Consistancy in
this regard is 90% of the game.

> Anyway, as y'all can probably tell, this is a pet peeve of mine.  I've put
> out my opinion and so I'll drop it now. :)

Ok, I'll shut up too then.

Brian Hatch                  If a turtle doesn't
   Systems and                have a shell, is it
   Security Engineer          homeless or naked?

Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : http://mail.pm.org/archives/spug-list/attachments/20021227/011d5d6f/attachment.bin

More information about the spug-list mailing list