Wednesday, March 12th, 2008

Levels of Abstraction

In everyday language “levels of abstraction” sounds like daydreaming or going off somewhere in a trance. In computing abstraction is our daily bread. A higher level of abstraction means doing more with less effort. Programming languages inevitably gravitate towards higher levels of abstraction. Let us see how.

The C programming language reigned supreme for many years. Few readers would remember anything before C, but long before the PC era it offered a platform for portable software. It replaced machine-specific assembly language. In effect it became a new universal assembly language.

After C there was an uncomfortable void. Object orientation was begging to enter. C++ would seem to be the natural heir but it was too rooted in old mental models to become popular. It also had great difficulties becoming portable. There were several other attempts, but no one really caught on, except perhaps Visual Basic.

Then there was Java. The language contains several new abstractions as compared to C. The most important one is that memory is no longer visible. Other important abstractions are objects, threads and exceptions. A programmer gets at least five times more productive in Java than in C.

Programmer productivity means everything. It’s more important than speed. If the application is slow, throw in more hardware. These days even soft real-time applications like telecom run in Java. In fact, server-side Java is probably hotter than client-side where most people originally assumed it would stay.

Java contributed immensely to computing by its database interface, JDBC. Before JDBC every database supplier crafted their own programming interfaces. There was ODBC of course, but it’s an extremely painful way of coaxing a database into being useful. By virtue of its abstractions JDBC was a forceful departure from clunky database programming.

Now that Java has been out for over 10 years it’s time for a new shift into higher-level abstractions. Pioneering (now established) languages like Python and Ruby have demonstrated still higher programmer productivity. It’s interesting that the trend seems to be away from static typing.

Groovy is a language in the Ruby tradition that builds on the Java virtual machine. An enormous amount of useful Java libraries has accumulated over the years. The Java virtual machine (JVM) is an extremely well-engineered engine. Groovy leverages these tremendous assets. Java is on its way to become the next universal assembly language.

It’s interesting to note that a few programming languages still in use were created in a completely different era of computing. Lisp and PostScript come to my mind. These languages aimed for a level of abstraction that was almost unthinkable at the time they were conceived. The level of abstraction is the main reason they have survived. In fact, the level of abstraction is the main reason any system survives.

Comments are closed.