3 ms·
"If I spend 5 hours writing code, and then throw it all away, I'm not productive." Writing throw-away prototype code can be very productive, since it's a way t
by greenyoda 13y ago
"If I spend 5 hours writing code, and then throw it all away, I'm not productive."
Writing throw-away prototype code can be very productive, since it's a way to learn about your domain and the problem you're trying to solve. It can certainly contribute toward making a better final product. If we're trying to solve hard problems, we can't expect to be able to come up with a perfect solution on the first try with no backtracking.
As Thomas Edison said about his numerous unsuccessful attempts to make a light bulb, "I have not failed. I've just found 10,000 ways that won't work." Each unsuccessful attempt got him a bit closer to being able to make a working light bulb.
"Using your example of refactoring 1000 lines of code, if the 1000 lines ends up doing the same as the 100 lines, how have I added value to the business?"
Speaking from first-hand experience, sometimes the code base you inherit is so bad that you can't add anything to it without breaking it. By refactoring, you've made it possible to add the new functionality to the code which your customers desperately need. You've also probably made the code more reliable, since there's less stuff in there to break in the future.
On the other hand, if you had code that worked perfectly and didn't require any new features, and you refactored it merely because it offended your sense of esthetics, then you were probably not being productive.
- kybernetikos 13y ago> Each unsuccessful attempt got him a bit closer to being able to make a working light bulb. Wikipedia on the merger between Edison and Swan - "The lamp bulbs manufactured by the company were almost entirely to Swan's design."