Stupidly simple API code

I have written code intended for reuse by others in their applications. They have had access to me and could also extend the code themselves. I discovered today that someone have written new code of (low-level) functionality that it is already offered by the old code. Why? I can imagine, is that they didnt understand the old code properly. Maybe it was too complex. Maybe they didnt think it would offer that. Maybe they were in a too big hurry to ask me. Maybe they asked others who didn't know it as well either. Maybe the new code was so small they didnt bother to reuse old code.

Is this possible to avoid this in the future? Maybe with complete tiny documentation of all our modules we could have avoided one of the reasons. I think the old code was too complex for them to understand. Thinking about this makes me leads me to believe the API of the old code is not really good. Its search API is not easy. There is a method for searching, but it is delegating search parts to other classes. Hm. on the other hand, they couldn't have studied the code much, for they would find the search method if they had read the class properly. Oh well, seems I need more populated data to reach a conclusion.

This example illustrates that duplicated code is something that occurs. Keep API code clean and simple, well described and well understood. KISS rule rules again: Keep it stupidly simple. :-)

Kommentarer

  1. I'm sure that was me... ;)

    Kijn

    SvarSlett
  2. Hehe, could have been.
    Nice to see one out there reads this.

    SvarSlett
  3. Anonym17:12

    Keep up the good work.

    SvarSlett

Legg inn en kommentar

Populære innlegg fra denne bloggen

5 generations of computer languages

Equal salary encourages more job jumping