Kurt Stephens

Nerd Up!

Abstraction .vs. Optimization

Kurt on Mon, 2009-11-30 01:10.

http://www.computerworld.com/comments/node/9141465#comment-553333

Abstractions can lead to greater flexibility and correctness at the expense of speed or size — there are good reasons that most programs are not crafted in machine code.

The key to improving an abstraction’s performance is to compile it. Dynamic environments like Common Lisp are superior to languages and tools like: Java, C++, and C#, in this regard, because one can create abstractions that compile to efficient code.

If the abstraction is cumbersome it might be a poor abstraction or its platform is poor for abstraction. Environments that give seamless access to a language’s compiler from inside the language itself are superior platforms for abstraction.

But one must understand what is really happening at levels of lower abstraction. UML class diagrams are a great language for describing the relationships between concepts, esp. before coding them. But if one does not understand the different ways a UML Association can be mapped to lower levels of abstraction, e.g.: as a foreign key in a SQL table or an instance variable pointer in a C++ class, that UML diagram is pointless, as much a C++ program itself “pointless” to a CPU, until it is compiled.

I forget who said, maybe Guy Steele, we should focus on programming languages that can be used to efficiently create new languages — stop using tools that do not facilitate abstraction and extension succinctly. Look into Ian Piumarta’s work at vpri.org for an example of the power of the “right” abstractions. Proper and thoughtful abstractions translate to less code, that is more correct, less error-prone and sometimes of greater performance.

Without abstractions, mathematics would still be stuck at 1 + 1. If one does not understand addition, one cannot understand or appreciate multiplication.


links: Kurt's blog | add new comment | 1100 reads

Primary links

Syndicate

Syndicate content

Browse archives

« February 2012  
Mo Tu We Th Fr Sa Su
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29