Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Some of use just want to know the basics

by mothra (Hermit)
on Jan 25, 2001 at 05:52 UTC ( [id://54176]=note: print w/replies, xml ) Need Help??


in reply to Some of use just want to know the basics

I'll offer my thoughts on copying and pasting, if only because I feel pretty strongly about them. :)

Never copy and paste code.

There's no magical reasoning for this. It's quite simple actually. When you innoncently think "oh! I'll just copy and paste this code here, make a few changes and I'll be finished!", it rarely works out that you actually REMEMBER to make all of the changes that were necessary.

Of course, I'm not talking about the copying and pasting associated with pieces of code that should be put into a module, but with pieces of code (perhaps even one if statement that you want to make into four) that "almost" do what you want, but not quite.

The one situation where I'll use copying and pasting is when writing stored procedures in SQL. It's much faster to copy and paste table names and columns (one at a time usually) than it is to keep retyping them.

  • Comment on Re: Some of use just want to know the basics

Replies are listed 'Best First'.
Re: Re: Some of us just want to know the basics
by lemming (Priest) on Jan 25, 2001 at 06:01 UTC

    For a real world example of cut-n-paste wrong doing: This idiot had made multiple modules with this error in it: The code was Info-Basic, but I'll present it "Perl" style

    for ($x=1; $x < 999; $x++) { ProcessAccountNumber($x); }
    He did this for every single number based item. ("Gee, we'll never see numbers that big.") Yes 999, for transactions he used 999999.

    Ow. remembering that hurt.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://54176]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-16 12:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found