In his November 2000 article ''Program Repair Shop and Red Flags,'' MJD calls repeated code
the red flag of all red flags: Any time a program does something twice, look to see whether you can get away with doing it only once.
He emphasizes the point later:
The Cardinal Rule of Computer Programming is that if you wrote the same code twice, you probably did something wrong. At the very least, you may be setting yourself up for a maintenance problem later on when someone changes the code in one place and not in another. ... Each time you see you have written the same code more than once, give serious thought to how you might eliminate all but one instance.
Source: http://www.perl.com/lpt/a/2000/11/repair3.html
Previous | Back to start of show | Next |
Slide: 3 MJD_q1 | © 2003 James E. Keenan |