DevOps Zone is brought to you in partnership with:

Jakub is a Java EE developer since 2005 and occasionally a project manager, working currently with Iterate AS. He's highly interested in developer productivity (and tools like Maven and AOP/AspectJ), web frameworks, Java portals, testing and performance and works a lot with IBM technologies. A native to Czech Republic, he lives now in Oslo, Norway. Jakub is a DZone MVB and is not an employee of DZone and has posted 155 posts at DZone. You can read more from them at their website. View Full User Profile

Code Is Cheap, It’s Knowledge Discovery That Costs

12.10.2013
| 5449 views |
  • submit to reddit

If we knew exactly what code needs to be written, what needs to be done and how it can be done, we would need very little time to write it. It is the discovery of the knowledge what to build and how to build it that takes all the time. Yet non-developers usually see it as an unacceptable waste to write and then throw away – and perhaps rewrite – code.

Conclusion

Do not hesitate to write throw-away code – proofs of concepts, spikes, experiments etc. – and then actually throw it away. Remember the difference between the cost of code typing and knowledge discovery. Hopefully it will make it easier to justify it to non-devs. Especially given that a N+1 attempt usually yields a better result than the previous one since we have learnt something.

Resist the evil temptation to build further on your “throw-away ” code. You wrote it optimizing for learning, not for good, understandable, robust code that shall live long. We know how important a good foundation is for a house, why do we think it is different for software?

P.S.: Dan North had a wonderful talk at NDC Oslo 2013 about his “craziest” project (where business people coded with devs and devs paired with businesses people on their work). They wrote the first version of the business critical system in two weeks and then threw it away and rewrote it in a different language, building on all they have learnt.

Published at DZone with permission of Jakub Holý, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Andreas Schilling replied on Tue, 2013/12/10 - 4:47am

 Well, "code&throw away" is actually simply called "prototype" :-)

It's just one of the worst practices in our industry to make a product out of a prototype or to start with "a quick solution just for the first run" which then ends up to be the next long-term production system. I hate ot every time it happens around me.

When I could start my first project from scratch at work we actually threw away our prototype which was worth approx. 1 1/2 weeks of work and my boss back then was like *GASP*. On the long run nobody never, never ever asked about those few days again and I'm sure the project gained really ALOT from not being built on the protoype. I just know too many projects where package names, bundle names, version numbers and the like are still a mess from the prototype phase and nobody ever bothered to fix it (of course) and everything is slowly rotting...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.