From LQWiki
In computing, abstraction refers to the layers of software that rest between the programmer and the hardware. Abstraction allows the programmer to focus on what to do, relying on the underlying software to figure out how to do it.
In programming languages, there is a progression of abstraction. Machine language, which is just hex or octal representation of the actual opcodes which make up a binary, is the least abstract. Above machine language, there is assembly, high level languages, and interpreted languages, each one more abstract than the last. Languages, such as Java, that are compiled into bytecode fall between HLLs and interpreted languages in terms of abstraction.
Contents |
Pros and Cons of Abstraction
The main advantage to abstraction is that rather than reinventing the wheel, the programmer can move on to more important things.
Secondly, since the "how to do it" part only has to be worked out once per architecture, the more abstract a piece of software is, the easier it is to port it.
A third advantage to abstraction is that it tends to make it easier for newcomers to learn how to program. However, the real intent is to allow the experienced programmer to do more in less time.
However, abstraction comes at the price lowered efficiency for the resulting program. For example, compiled, or high level language code, is in theory, less optimized than assembly or machine language. But in practice, HLL is, on average, more efficient than assembly. This is because, while computers might not be as brilliant as human programmers, they don't make mistakes. They do exactly what you tell them to.
Handhacking
Since certain parts of a program take up greater amounts of runtime then other parts, efficiency gains can be made by using a HLL to create a binary, and then handhacking heavily used sections in assembly or even machine code.
Increasing Abstraction Over Time
As computers get more and more powerful, the efficiency of code becomes less important, relative to coding time and code maintainability. (See Real Programmer, Story of Mel.) On the downside, this trend towards greater abstraction is the root cause of Gates's Law.
This trend towards greater abstraction can be seen in the history of programming languages. It is said that von Neumann criticized the use of assemblers, saying that it was a misuse of valuable scientific equipment, and that such clerical tasks should be done by grad students.
The first widespread HLL, Fortran, was not designed as a general purpose language. Rather, it was used to bang out scientific computing, number-crunching applications. "Real" programming continued to be done in assembly. Unix was the first operating system ported to a HLL (C).
Today, most "real" programming is done in HLL. However, compiled bytecode Java is often used for the purposes of portability. Handhacking is reserved for optimizing critical, foundational programs where time is of the essence, such as kernels and device drivers. Interpreted languages are extensively used in web-based applications, such as this wiki, but are also seeing increasing use in general-purpose applications.

This page is available under a