Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

See my home page [].

Journal of merlyn (47)

Thursday February 03, 2005
09:20 AM

the right person for code review is scarred

[ #22994 ]
The right person to do code review is not just someone who has programmed a lot of successful projects, but someone who has broken enough things and gotten the scars to prove it.

For example:

if (ref $this_thingy eq 'Foo::Bar') { ... }

is just obviously wrong to me and worth flagging, because I got burned once by having to subclass the Foo::Bar for part of the application. Similarly,


is very obviously bad SQL to me, because I managed to break an application when I accidentally deleted a column and then re-added it, changing the order of the columns.

Scars. Wear them proudly.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Good point!

    I wonder if it would be worthwhile to have Perl programmers contribute their scar stories to a wiki or other sort of interactive web page ... a kind of "traps for the unwary" list for learners (which is everybody <g>).

  • This isn't necessarily anything wrong with using SELECT *, relying on the order of columns returned is the problem.

    I remember reading somebody saying that you should always use an ORDER BY clause in SQL, which is useless in the cases where order doesn't matter.

    Sometimes order does matter, sometimes it doesn't, it's about using the right tool for the job.
    • This guy's absolutely right. You shouldn't be depending on the order of the columns returned, you should address the values by the columns. There's different ways to do that: named bind variables, returning each row as a hash keyed by its column, etc.
    • I know that I've said results returned should always use "ORDER BY" and I was (again) being stupid. I was pissed off at a programmer failing to sort his results properly and when I get annoyed, I say stupid things.

      In that case, the programmer eventually sorted the data, in Perl. That's usually stupid when the database can handle it. In our case it resulted in a bug whereby the data always had to be sorted but sometimes we were getting it before it had been sorted. The problem (and this is merlyn's poi

  • I used to tell my clients to be suspicious of any consultant who came in like "a knight in shining armor".

    You want the knight whose armor is old, rusty, and has plenty of dents and dings. Shows they've fought real battles.