Maybe it's a programmer thing, but we only care about filling the need of the customer. Doing the bare minimum to meet the requirement. We forget about all of the administrative stuff we have to do (until the very end of a project) like : refactored, coding standards, design, documentation, automated unit tests.
And we think that because our customer wants it "RIGHT NOW" that we can't possibly spend the time to do these other tasks. They wouldn't have it! there would be another emergency where we have to drop everything and just 'Get it done'.
We can blame these bad managers all we want but the responsibility lies within us to do the right thing for the code and in the end when we don't... it will be our butts on the chopping block. Believe it!
So why do we care? Damned if we do, damned if we don't.
I come from the restaurant business so i really liked this story that i heard one time.
Let's say i'm in a restaraunt but i'm on my lunch so i don't have much time to eat. I want a steak so when the server comes over i say, give me a steak, i want it well-done, but i'm in a hurry so if you can't get it out to me in 10minutes i'm going to have to leave and pickup fast food on the way home.
THe server scrambles to the back and rings in a steak then tells the cooks "use magic" to get this steak out. Well 'magic' in the food industry means use the microwave. In fact any time a server screws up an order and needs it out in a hurry... they go to the magic.
So my steak comes out in 8minutes. I'm ecstatic and i begin to cut into it. O man, i am so disappointed. The steak is so tough my knife barely gets through the rugged microwave hardened gristle. It's so dry i have to soak it in steak sauce. I am angry! I demand they comp my meal for such a disappointment. I leave absolutely no tip on the table and go back to work in disgust.
The poor waiter curses me for my arrogance because what should that idiot expect wanting a steak well done in 10minutes is absurd! How else was it suppose to get done.
Frankly, this is how software is a lot of times. The customers want insane things to happen in insane time lines and no one questions them! Their ignorance is compounded by our willingness to appease them.
Defining done up front of a project or before a sprint ensures that this negotiation happens BEFORE it's too late. before they get a bad steak, let them know that you need to do documentation, training, refactoring, unit testing, regression testing, continuous integration setup, code analysis, code review, security scans.
Fact is, if you don't discuss it... as soon as the code "looks ready" to them, they won't understand why it's not ready and be pushing to move on to the next thing. And admit it... so will you... because you don't want to do all that administrative crap, you want to write code!
Think about it... gimme a shout.