The law of leaky abstractions
I’m suspicious of people who don’t enable commenting on their blog – that just makes it a book. But this gripe aside, I like what Joel Spolsky has to say about abstraction in modern programming. Well, it pushes one of my buttons; perhaps “like” has nothing to do with it.
Sadly the people I feel need to appreciate his point the most probably won’t get past the second paragraph. That point, or at least the one I took away from it, is best summarized by this quote:
“[...] as we have higher and higher level programming tools with better and better abstractions, becoming a proficient programmer is getting harder and harder.”
Bang on. Except, maybe not harder, but just less likely. In the [invariably rapid] world of creative web development this is known as “getting shit done”. Young developers in my business don’t learn JavaScript; they learn jQuery. They don’t learn PHP, they learn [ahem] WordPress. (as if PHP wasn’t already a high level abstraction). Now don’t get me wrong! I’m not pleased about this, but there is a happy medium to be found somewhere, and I don’t believe we’ve all settled on it yet.
Joel is pretty hard on the idea that abstraction saves us time, and seems to argue that on balance the time saved working is still spent learning. Maybe this is true of people who do the learning, but many do not. And sometimes it just isn’t practical. The ActionScript world seems to be dominated at the moment by PaperVision 3D. Obviously you should have buttoned up your AS3 before diving into a library like this, but as for a solid understanding of the 3D engine; what are you going to do? Pop out for a quick doctorate in 3D mathematics in your lunch break? There is not doubt that this huge abstraction empowers many developers with some real might, with some very real time saving.
I have always maintained that the more you understand about what lies beneath the abstraction layer in which you are working the better you will be at your job. Would you train someone on Dreamweaver, before they proved they could write HTML? However, there is a balance to be found that works for you and your business. Web development would be impossible without the many layers that exist between the code in an HTML page and the OS of the server dishing it up. As the web evolves more layers tend to get added, and nowadays popular code libraries are adding layers within layers.
At the bare minimum you have this: (please excuse rudimentary linear format, and refrain from posting flowcharts)
HTML < Browser < HTTP < Server
Then we add a wizzy AJAX front end and some back end architecture:
JavaScript < HTML < Browser < HTTP < Server < PHP < MySQL
Then we use some cool 3rd party libraries to save us some work:
jQuery plugins < jQuery < JavaScript < HTML < Browser < HTTP < Server < Drupal modules < Drupal < PHP < MySQL
The more layers, the more points for possible failure. If you only have knowledge (i.e. control) of one or two of these points you are in a weaker position when things go wrong. If you have knowledge of all these layers you are in a much stronger position to harness the value of the extra layers, rather than suffer from them. This kind of philosophy is rarely evaluated when people make business decisions off the back of a Drupal press-release, but it’s one that I ensure I keep an eye on, especially when recruiting.
This area is of particular interest to me at the moment, so expect more posts on the topic.
I see this abstraction happen quite a bit. I am still a student. A senior Telecommunications Major at Ball State in Indiana. The part that really hit me hard, when I took on a TCOM major instead of a CS major I was looking to learn the side of development that I really didn’t know much about. I already had the CS stuff down pretty well. Once I actually got into the classes I was appalled at what I was seeing.
THE “programming” class was made up entirely of a professor teaching the front end of Dreamweaver to students who have no experience with HTML or how it works. I started teaching workshops on campus a few years ago to give these students a little more depth in this. I taught “advanced” dreamweaver workshops as well as “advanced” flash workshops where I took the students out of their comfort zone and taught them HTML and AS 2/3 so they could fix stuff when something went wrong.
If this says anything about the abstraction and how bad it got for a while, about 75% of the students who came to me for help had absolutely no idea why their photos weren’t showing up on their website when they uploaded the HTML file to their server.
On the CS side of things, I noticed them being taught things like WordPress programming, or SecondLife programming (another big one). Most of them wouldn’t even delve into the ‘too complicated’ world of javascript, not even to mention AJAX.
I guess that’s just what happens when the professors get lazy and start teaching the lazy ways to do everything. (I ran into a Journalism professor who taught flash programming and managed to teach using only behaviors for everything she did)…. on a side note I was kind of impressed by how much she was able to accomplish with those and was able to make it so far without knowing how to write anything in actionscript past play/stop, and gotoAndPlay/Stop.
just my little rant that’s slightly off topic I suppose.