Skip to content
gqlxj1987's Blog
Go back

Write code easy to delete

Edit page

原文链接

Instead of building re-usable software, we should try to build disposable software.

To write code that’s easy to delete: repeat yourself to avoid creating dependencies, but don’t repeat yourself to manage them.

Layer your code too: build simple-to-use APIs out of simpler-to-implement but clumsy-to-use parts.

Split your code: isolate the hard-to-write and the likely-to-change parts from the rest of the code, and each other.

Don’t hard code every choice, and maybe allow changing a few at runtime.

Don’t try to do all of these things at the same time, and maybe don’t write so much code in the first place.

Error handling, and recovery are best done at the outer layers of your code base. This is known as the end-to-end principle.

Good examples of loose coupling are often examples of uniform interfaces.


Edit page
Share this post on:

Previous Post
Java meets reactive programing
Next Post
Istio Intro