Tuesday, January 25, 2011

Lessons of programming languages

Programming languages are more than methods of instructing a computer to perform instructions. They are techniques for us humans to organize our thoughts. The syntax and structural capabilities of programming languages tells us more about ourselves and our mental discipline than about the programs of a specific era.

Here is a run-down of the concepts that programming languages have given us:

From COBOL we learned that high-level languages are possible and practical. (There were many high-level languages, and many have been forgotten. COBOL remains and its lessons remain.)

FORTRAN taught us that programming languages can be portable, allowing programs to run on more than one hardware architecture. (COBOL taught us this too, to some extent.)

LISP is almost as old as COBOL and FORTRAN, but we didn't learn any lessons from it. (Not that it has nothing to teach us. Indeed, there are lessons. We didn't learn them.)

From Algol we almost learned that structured programming is possible. This was an important lesson, and most languages today use it. But it took a while for the lesson to sink in.

The lesson from PL/1 is that a language cannot be all things to all people and succeed.

BASIC taught us that there is (or was) a hobbyist market, and that individuals, including high-school students, can write programs.

We learned from C that portable languages -- truly portable languages -- are hard. Despite the efforts of the creators (and later, ANSI committees), C was (and is) haunted by big-endian/little-endian disputes and ambiguities of the size of an integer.

From Pascal, we learned (again) that structured programming is possible. This time, the lesson stuck. I think that every language created after Pascal adopted the concepts of goto-less programming.

The lesson from ADA is that a language cannot be all things to all people and succeed. And that we didn't really learn the lesson of PL/1. A side lesson of ADA is that the US Department of Defense was no longer large enough to force a new language onto the industry.

The C++ language taught us that we can use object-oriented programming (and that we are capable of designing and writing object-oriented programs). It also taught us that complex languages can be accepted by the mainstream developers, at least for a while.

Visual Basic taught us that a vendor-owned language is subject to the whims of the vendor. Microsoft issued six versions of Visual Basic in its lifespan (not counting the current VB.NET release), and many new versions changed the syntax of previous versions, creating maintenance headaches for people who committed to Visual Basic.

Java taught us multiple lessons. It taught us that object-oriented programming does not have to be incredibly hard (as in C++) but can be merely hard. It also taught us that virtual processors were viable technology. Microsoft learned from this lesson and built the .NET platform, using concepts from Java and the much-earlier (and failed) UCSD p-System.

In some ways, Java can be seen as an admission that truly portable languages are not possible (or are at least very difficult). Java achieves its "run everywhere" capability by using the trick of a virtual machine tailored for each hardware platform, and has had challenges with uniform GUI operations.

The lesson from Python and Ruby is that dynamic languages can allow for nimble development. Coupled with agile practices, we learned that static typing and design-up-front is not necessary for effective development of software.

Looking forward, I think that we will continue to learn lessons from programming languages. The next lesson may come from functional languages, which may teach us that programs can be reliable and high quality. But that lesson remains to be seen.

No comments: