xhtml
 

Copy and Paste

The programs we have seen are all very similar, and they are just long enough that it is worth trying to avoid retyping all the bits that are the same. The usual way to do that is to use copy and paste. The exact way to do that differs from one platform to another and one editor to another, but a common convention is to mark the text to be copied with the mouse (click the button, hold it down, and drag) and then use CTRL/C to copy and CTRL/V to paste into another window.

Copying text in this way has advantages and disadvantages:

The upshot is that you should use cut and paste wherever appropriate, for example to copy code from other programs or Web pages into your current prorgam, but take care. Always read carefully through the copy to see if anything needs changing. Never copy and paste code where you should be using a loop or a method, which are much cleaner, more compact, and more flexible ways to reuse code.


Back