On Mon, 2005-03-07 at 15:33 -0500, Uri Guttman wrote:
> >>>>> "AS" == Aaron Sherman <[EMAIL PROTECTED]> writes:

> see what i do in File::Slurp. i wanted a single error handling sub but
> also to have the croak in there report back from the original call (say
> read_file).

Tried that. Problem is File::Copy is the kind of thing that's going to
be called often and fast, and there's nothing short of an eval that
stops performance dead more than an subroutine call in Perl. Ah, Perl 6,
where are you?

Of course, now (many years later) XS support is much better, and I'm
sure I could do an XS File::Copy that would eliminate the need for that
goto ;-)

> it had was gotos and even then i structured my code as much as
> possible. i have never done spaghetti coding at any point in my
> career. maybe i have more innate understanding of logic than some but i
> always wonder how spaghetti coders think (or rather don't think! :).

Well, that's the point. The language is the tool, not the programmer.
You use the tool to perform the task at hand. If that means bending it
in funny ways, then that's what you do. Gotos are the programming
equivalent of duct tape. If you see duct tape, you know that there was a
limitation in the tool or the tool-user that made the duct tape
necessary. In this case, it was the tool, and in all these years, no one
has ever re-written that chunk of code without gotos and without a
performance or readability hit.

Like I say, it'll be a (not so) fond memory once P6 takes over the
world.


 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to