Description: An effective approach for simple software API design. Principles and techniques that everyone who write code should adopt.
design (78126) software (35104) api (2420) software engineer (1965) software engineering (1301) computer programming (157) encapsulation (89) api's (18) deep apis (1) deep api's (1)
A few years ago, I underwent the stressful task of moving my family about 240 miles to another city. Of the many logistical issues I tackled, one of the most interesting came near the end of the whole process. Alone (my wife was out of town), I needed to transport three vehicles (a minivan, a sedan, and a motorcycle) to our destination — a four hour drive each way — and I had a five-week window in which to devise and execute a solution. I was reminded of the well-known river-crossing logic puzzle. When aske
When I design software, I wait (sometimes hours, or days, or even months) until I have come up with a simple design before writing any code. This requires some degree of patience and maturity, but often pays off in the long run. By ‘pay off’, I mean reduced maintenance time: easy to extend, easy to understand, easy to use, etc. In the following paragraphs, I will explain how I do this and why I think every software developer should adopt similar strategies.
As I patiently design software that meets my standards, I have an internal metric to know my design is correct. I know that correctness is a subjective measure, indeed there are often multiple correct designs, but I assert that a simple design is a correct design. I use the metric that if it requires little-to-no mental exertion to process my design, then it is simple enough to put to code. As I explain this concept to others, I state that it should take less than 30 seconds to either mentally process or ve