资料内容:
Best Work
Promise 2. The code that I produce will always be my best work. I will not
knowingly allow code that is defective in either behavior or structure to
accumulate.
Kent Beck once said, “First make it work. Then make it
right.”
Getting the program to work is just the first—and easiest—
step. The second—and harder—step is to clean the code.
Unfortunately, too many programmers think they are done
once they get a program to work. Once it works, they move
on to the next program, and then the next, and the next.
In their wake, they leave behind a history of tangled,
unreadable, code that slows down the whole development
team. They do this because they think their value is in
speed. They know they are paid a lot, and so they feel that
they must deliver a lot of functionality in a short amount of
time.
But software is hard and takes a lot of time, and so they feel
like they are going too slowly. They feel like they are failing,
which creates a pressure that causes them to try to go
faster. It causes them to rush. They rush to get the program
working, and then they declare themselves to be done—
because, in their minds, it’s already taken them too long.The constant tapping of the project manager’s foot doesn’t
help, but that’s not the real driver.
I teach lots of classes. In many of them, I give the
programmers small projects to code. My goal is to give them
a coding experience in which to try out new techniques and
new disciplines. I don’t care if they actually finish the
project. Indeed, all the code is going to be thrown away.
Yet still I see people rushing. Some stay past the end of the
class just hammering away at getting something utterly
meaningless to work.
So, although the boss’s pressure doesn’t help. The real
pressure comes from inside us. We consider speed of
development to be a matter of our own self-worth.