Next | Program Repair Shop | 62 |
Repeated Code is a Mistake
It is nearly always possible to eliminate repeated code
Almost every feature of every programming language is an attempt to prevent repeated code
Tiny example: $x->{q} += $y instead of $x->{q} = $x->{q} + $y
Larger example: Small-scope variables
Larger still: while and for loops
Larger: Subroutines
Larger: Object-oriented inheritance
Larger: Modules
Larger: Pipes
Huge: Shared libraries
Next | Copyright © 2002 M. J. Dominus |