in reply to Tact and the Monastery
I'm always leery of these "this other guys code was a mess" comments. Certainly it's sometimes (mostly?) true, but "messy" is in the eye of the beholder.
For example, I tend to use lots of temporary variables where they probably aren't needed. I've gotten negative feedback on that. I think, however, that they make the code more maintainable:
Now, the @chars and $salt variables aren't really needed, and I could have done something like:# crypt the password my @chars=(a..z,A..Z,0..9,'.','/'); my $salt= $chars[rand(@chars)] . $chars[rand(@chars)]; my $crypted=crypt($password,$salt);
which is more compact, but less readable, IMO.my $crypted = crypt( $password, join( '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')[rand 64, rand 64]));
I've also gotten negative feedback on code reviews for overly defensive programming, which again, adds lines of code and generally makes for more "mess". ( additional eval blocks, lots of defined() calls, etc).
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: Re: Tact and the Monastery
by merlyn (Sage) on Sep 15, 2002 at 00:34 UTC | |
by rir (Vicar) on Sep 15, 2002 at 05:56 UTC | |
by rir (Vicar) on Sep 18, 2002 at 02:48 UTC | |
by admiraln (Acolyte) on Sep 27, 2002 at 17:25 UTC | |
by rir (Vicar) on Sep 27, 2002 at 20:59 UTC | |
Re^2: Tact and the Monastery
by Aristotle (Chancellor) on Sep 15, 2002 at 07:55 UTC | |
Re^2: Tact and the Monastery
by Flexx (Pilgrim) on Sep 14, 2002 at 22:36 UTC | |
by Aristotle (Chancellor) on Sep 15, 2002 at 08:00 UTC | |
Re: Re: Tact and the Monastery
by helgi (Hermit) on Sep 17, 2002 at 11:46 UTC | |
Re: Re: Tact and the Monastery
by talexb (Chancellor) on Sep 20, 2002 at 17:01 UTC | |
by Aristotle (Chancellor) on Sep 21, 2002 at 08:55 UTC | |
by talexb (Chancellor) on Sep 22, 2002 at 02:51 UTC | |
by Aristotle (Chancellor) on Sep 22, 2002 at 03:43 UTC |