5 ms·
Three Kinds of Code
- Tichy 17y ago"Code that’s built to last. Well factored, well understood by the team, with strong automated tests, and generally meeting the team’s standards for something they’d happily maintain forever." Name an example of code of that kind?
- olliesaunders 17y agoPretty much all code can potentially be run for a long time and be subjected many alteration requirements, making high quality dev practise worthwhile. But if you want a archetypal example: libraries.
- warfangle 17y agoSome libraries. And then there are libraries like Prototype and Scriptaculous.
- Tichy 17y agoAre they good or bad examples?
- Tichy 17y agoI'd expect few libraries to still be very pleasant to work with after a couple of years. For starters, one might not even want to use the programming language they were written in anymore.
- DenisM 17y agoAnother way to bridge the communication gap is to introduce the notion of "engineering debt" aka "technical debt". If you can quantify the day-to-day impact ("the interest payments"), amount of work it would take to fix it ("the principal") and the ongoing accumulation of crap ("the negative ammortization loan") you will be loved by both engineers and managers.
- Tichy 17y agoStill, there is the 90% rule that code can not overcome, either: 90% of everything is crap (except crap, 100% of crap is crap).
- sunkencity 17y agoI think the key to write fast code is to compartmentalize. Write someting crappy but that's walled off into a class, or file so that it can be thrown away later on. I'm a bit tired of the notion that all code needs to be ready for a mission to the moon, or needs to be reusable. It doesn't -- it just needs to do the job. If part of the job is to be the foundation of years of work to come, then yes, it needs to be brilliant. If the code you are writing is a quick hack to generate some images or to present some data on a single web page, time matters more than that is can be extended ad infinitum. Write something quick -- and maybe you can have the time to write some tests as well.