Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Trig in Perl

by astaines (Curate)
on Sep 04, 2001 at 13:21 UTC ( #110000=note: print w/replies, xml ) Need Help??

in reply to Trig in Perl

I used to see code like this a lot - this is more or less how many people wrote Fortran. There are *lots* of variables being passed to most of the subroutines - COMMON blocks. There are many many lines each doing some simple arithmetical manipulation. The main control of program flow seems to be through a couple of globals - whatfound and whatfound0.

I could never fix, understand or maintain code in this style, and I used to rewrite it as it was ultimately less painful.

It is faster to write code like this, for something that will only be done once. If it's going to be done twice, you should reconsider your basic design. Also if it doesn't currently work properly, as you suggest, a rewrite on more organised lines is probably the fastest way of fixing it.

-- Anthony Staines

Replies are listed 'Best First'.
Re: Re: Trig in Perl
by John M. Dlugosz (Monsignor) on Sep 04, 2001 at 21:05 UTC
    Actually, those variables are not being passed! He seems to declare all his local vars as a parameter list, but @_ doesn't contain all that. It's usually empty, in fact.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://110000]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-05-26 16:58 GMT
Find Nodes?
    Voting Booth?