In this week there is an interesting discussion about including Mono in Debian. The problem is nicely explained by Richard Stallman in ‘Why free software shouldn’t depend on Mono or C#’. It contains the statement that ‘[i]deally we want to provide free implementations for all languages that programmers have used’. It is clear that providing differs from using, so should we use all programming languages/tools that have free software implementations free of patent problems?
Initially I though about languages like Fortran and TECO (the editor on which the original Emacs was based) which were important in elder days, but now have very limited use (I used only one program written partially in Fortran, the R system for statistical computing; scientists still use Fortran for processing large amount of numerical data). Clearly, older programming languages are replaced by newer, improved ones. Now K&R C is largely replaced by ANSI C and with one significant exception Python 2.5 is supported by software initially designed for older versions. There are programs known to be rewritten in ‘new’ programming languages, like Maxima in Common Lisp which replaced Maclisp (I haven’t seen any other program with copyright notices from 1969; I’m more then twice younger that this program). Adding features made vi much more useful than ed except in extreme situations.
But usually the evolution of programming languages is not linear, with only one useful branch. COBOL, the third oldest high-level programming language, is still used. There are many languages which have better alternatives, for example AWK is usually replaced by Perl (as Eric S. Raymond wrote in ‘The Art of Unix Programming’), or TROFF replaced by TeX for most uses except man pages (although TeX-based Texinfo is used for documentation of the GNU system). As stated by ESR Perl was designed to replace AWK. Similarly, TeX was designed partially to replace TROFF by being not compatible with it, allowing better design (as explained in an interesting interview with Donald E. Knuth); the same argument made TeX82 better than TeX78.
There are also cases when a programming language is not clearly better than another one. C# differs from Java in many issues, but they both have generally similar design. I’m not sure if there are important arguments in that case other than the freeness of implementations and availability of software written in these languages.
These are not the worst cases. COBOL and BASIC are considered harmful to the minds of their users (also to the companies which paid for the Y2K bug). As stated in the Jargon File, a part of the problem with BASIC is that writing short programs in it is easy. Now PHP is considered easy, it makes most security problems of the Web incredibly easy (an article on the Plone website explains how the Python, Zope and Plone avoid these problems and gives some supporting statistics), at least one of the most important ones is presented in XKCD. I’m not sure how commonly used with PHP database server MySQL differs in security from e.g. PostgreSQL, but my only experience with MySQL (except using it and resetting passwords) was losing data and problems with non-ASCII characters. PostgreSQL is marketed as more reliable, but much software written in PHP does not support it. I do not have these problems by using only Python-based web applications (they usually use ORMs supporting equally different SQL database systems, or the object database of Zope) on my server, but still MySQL is required by KDE 4.2 in Debian (in Gentoo of KDE programs which I used only Amarok requires it).
There are cases when supporting better (maybe not written yet) languages is easy, for example using ORMs or portable SQL instead of one working only with MySQL, or using dash as /bin/sh instead of Bash when writing shell scripts (it makes them more portable to systems like FreeBSD which uses faster POSIX shells instead of Bash). But usually there are no solutions other than a complete rewrite of a program, clearly easier with simple programs doing one thing correctly.
