in reply to Code review on script site

This sounds great. A few minor points, though. (I hope they don't sound too nitpicky)

Here's a personal pet peeve: failure to check return value of functions. Not all functions, mind you. When was the last time you saw someone check the return value of print? However, forgetting to check the return value of an open or a flock could be disastrous.

I would also be concerned about how someone opens files. If they don't flock when they should, or if they don't flock correctly and risk a race condition, that would be a concern.

I'll post an update if I think of anything else off of the top of my head.

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: (Ovid) Re: Code review on script site
by Jazz (Curate) on Nov 24, 2001 at 06:20 UTC

    Ovid, not nitpicky at all. Excellent clarifications. I would think that the HERE docs and "\"escape syndrome\"" should be a separate point? Do you agree?

    Thanks :)
    Jasmine

    Update: Updated list is now being maintained in the root node.

      If they are scripts, I would +1 if the comments include examples of standard ways one would expect to call the script (command lines and sample output). This is really helpful in picking up a script.

      I can put my money where my mouth is. I have uploaded a couple of script to the Code Catacombs which do just that. I won't link to them directly, but search for pinger and nugid for a couple of examples.

      <update date="2001-11-26"> Here's a thing that is a definite no-no worth a -1: "gratuitous use of & when calling a subroutine" (e.g. &func($x,$y)) except if @_ is to be passed to the called routine... which is hardly ever the case. I find this to be pretty cargo-cultish, not to mention noisy.</update>

      --
      g r i n d e r