Next | Program Repair Shop | 62 |
if (! -e ".bak/$filename" || system("cmp -s $filename .bak/$filename")) { print STDERR "*"; push @SLIDES, $filename; }
I had a big argument with some programmers about this
They said "Calling cmp all the time is wasteful"
"You should maintain a file with MD5 checksums for each file"
My opinion:
Writing a lot of MD5 garbage when cmp works just fine is even more wasteful
To do 180 cmps takes under 4 seconds
The MD5 thing might be faster
But it can't be more than 4 seconds faster
Sufficient unto the day is the evil thereof
Next | Copyright © 2006 M. J. Dominus |