Perilous abstractions

I started pondering whether people are right when they say we are losing something through the use of libraries upon libraries.

APIs that wrap complex functionality are great - they allow you to reach your goal quickly; stand on the shoulders of others to get your work off the ground and functional in a much shorter space of time than if you cooked every single part up yourself.

But (and this is where I explain the random thought pattern that inspired this thought), what do we sacrfice? If you write everything yourself, you are famailiar with it inside out. You are aware of the quirks and intricacies, you know it's strengths and limitations.

If you use a library though, you know only what the documentation says; and today I realised that most of the documentation has stuff about the calling convention and not much else. I thought 'but where is performance: throughput, time?' I found a lovely little file browser today called muCommander - it seems like a great cross platform norton commander clone (and even goes beyond just local files with SFTP etc). However - when you are browsing in a directory and you are typing a subdirectory name it doesn't get suggested. Right, well I'm a computer scientist and this proram is written in Java (and after three years of university that means I can definitely sort that out).

So the programmer in me is awake and sets about pondering the task....there would be a method that returns an array of the children files of the current directory. Then I think, I might have to cache the results of this. 'I wonder if I do have to cache the results or if the implementation does it for me?'.

So what's the right thing to do here - in the time I'd spend going into the library to find out how it's done I probably could have written the cache code. Would I really gain? The likelyhood of me wasting my time reading through code or caching twice feels pretty high and I'm sure I've stumbled into a lose lose situation.

And all this is excluding the fact that things like the Java standard library are enormous and sometimes far over complicated for what you're trying to do - an abstraction too far? I think jQuery showed me that - do a couple of things really well, and the power gained from that is probably far greater than having a method/class/construct for everything. That's like assuming for others.

Even more so, I reckon it changes the way you develop. If it's spaghetti libraries, do you ever learn how things work properly and skill up, or do you become a consumer? As for what the answer is here I reckon this is that type of question that could rage on for a while. As for me, I think maybe it's a combination of decent APIs and, if a complex task is done for you, documentation that atleast allows you to appreciate what is going on underneath without you needing to understand it in gory depth; at least that way you'll be aware of not just features but also any constraints and how the code is best treated.

Hmm....there most definitely will be a part II.