Programming ≈ Fun

Written by Krešimir Bojčić

Memorize the Concepts Not the APIs

I was always ashamed of not being able to bang out code without looking at the documentation. One example was file opening/handling in .NET 1.1. I remember not being able to do it even if my life would depend on it. Later on I’ve read that Microsoft made the study about APIs usability. One of the APIs that missed the mark was the IO.

The main complaint was that you need way too many lines of code for basic scenarios.
The other complaint was that you need the knowledge of rather abstract (from the usage point of view) inheritance tree. That was a bit of relief. I stopped feeling as such an imposter that was getting payed for doing nothing. Still I regarded this as my flaw and was always irritated when unable to do simple stuff because I forgot API details.

Similarly, after finding out about Ruby I was amazed that alpha geeks figured it out five years before me. When I think about it more carefully, it would not be logical any other way. I speculate that they were able to position Ruby as a Smalltalk derivate that has some Perl syntax sugar and some Lisp functional goodness. That enabled them to label/recognize the whole technology relatively fast and easy.

The previous knowledge of concepts was the main factor that enabled that.

The matter of fact is that very, very rarely we get a new concept that is also usable at the same time.
This is double sworded. One side of it is that we are not making as much progress as we would like. The other side is that if you know enough you get to keep tap on new things. From this perspective it is useless to engage in holy-wars. You get to use previous knowledge and adjust technology trade-offs to your personal taste while recycling the existing ideas.

Concepts enable us to have a common vocabulary and to talk about problems more easily. They also transcendent the technology itself.

The matter of fact is that technology shelf life is 5-7 years. In that time something new will come along and evolve the state of the art. You have to ask yourself who are those people that are pushing the envelope. I think they are the one that are leaning on the shoulders of a giants from (glorious) past. They are able to look at technology instantly knowing its strong sides and limitations. I base this assumption on a fact that main factor in speeding up the whole human race progress was the invention of press machines. Books enabled people to share concepts on a much broader scale than before. Internet is in a way just improved and more interactive version of a book.

I bow my head to Lisp for giving as fold and map, I bow to Smalltalk for giving as block syntax and showing us how nice keyword arguments can really be. I bow my head to Unix for enabling us to connect programs the same way that we connect a garden hoses (standard input/output)…

Conclusion

Don’t just stand there, learn about traits from Smalltalk or about currying in (for example) Perl. That kind of knowledge is what is most important anyways.

Leave the APIs details in the documentation and look it up when needed.
Details grow irrelevant fast. Concepts on the other hand will serve you much longer and will be present in whatever new technology you are going to use.

Comments