next up previous print clean
Next: Why object orientation? Up: Object-orientation Previous: Object-orientation

Introduction

Computers perform complex tasks by executing many simple instructions. Humans specify these instruction by writing programs in a programming language. Programming languages combine individual machine instructions into more powerful compound instructions. They also allow new compound instructions to be created, named, and used as a unit. Computations expressed in these units communicate the program in a more abstract way, ignoring the detail of machine instructions and highlighteing the essential concepts of the computer solution.

I suggest to distinguish computer languages by three criteria: Expressiveness, ease-of-use, and efficiency. Expressiveness. Computer languages do not differentiate as much in what solutions can be implemented in a computer language, but in the ease with which a programmer can express and implement these solutions. Floyd  suggests that a programmer selects the computer language that expresses the needed programming paradigms [*]

Ease-of-use. I like simple languages, because it is hard enough to program well. Some languages are extremely expressive, but very hard to learn and to use. Computer scientists often mention Algol68, Pl/I, and ADA as languages that are overly complex (Wirth, Hoare). Especially, programmers in application fields have to avoid the Turing tar pit: a language that can express almost anything but cannot express anything conveniently.

Efficiency. Finally, computer languages execute with variable efficiency. I believe, that fundamentally, the languages do not differ in execution speed, but the abstraction a programer chooses come at a cost in performance. For example, Fortran90 can contain traditional Fortran77 code that will execute with the usual speed. However, Fortran90's more object-oriented features cost execution speed. The same is true for for C++ and C. Additionally, compilers for new languages will require some time to evolve to the efficiency of its mature competitors. So does application code written in such a new language. For example, A recent comparison of Fortran90 and C++ implementations of computational kernels at Lawrence Livermore Laboratory showed little difference in performance cite(http://jove.colorado.edu/ cary/CompCPP_F90SciOOP.html). Mature compiler and application optimization resulted in comparable performance. In summary, choosing a programming language requires a trade-off between expressiveness, ease-of-use, and efficiency. In general, a high-level, abstract language is more expressive but less efficient. Ease-of-use seems to be an art and requires most of all consistency.

I believe none of the current programming languages will prevail forever, but I believe the principle of object-orientation will be with us for a long time. Object-oriented languages allow a programmer to combine data and functions to an abstract compound unit, a class. For example, a particular program may require that a two dimensional array x(n0,n1) is scaled by a constant scalar a. Fortran77, C, C++, and Java allow the programmer to loop over the two dimensional array x using the array parameters n0,n1. However, the languages vary in the way, the programmer is able to package the data and operation into compound units. The Fortran77 programmer can write a subroutine arrayscale(x,n1,n2,a) that changes the array values. The C programmer may combine the two-dimensional array into a single structure xx. The C invocation may read then arrayscale(xx, a). Java (or C++) can combine the two-dimensional structure and its scaling operations into a single object xxx. The invocation of the array scaling method xxx.scale(a) scales the object's internal array values. Another method may compute the norm of the array elements or write the elements to a file. Such an object-oriented compounding of variables and functions leads to programming concepts that do not exist in traditional, procedual languages.


next up previous print clean
Next: Why object orientation? Up: Object-orientation Previous: Object-orientation
Stanford Exploration Project
3/8/1999