Does functional programming work?

bearophile bearophileHUGS at lycos.com
Sun Jan 3 06:00:53 PST 2010


yigal chripun:
> Compare to cars - the most popular and successful design is that of the internal combustion engine yet it's the worst design in technical terms, there are more effecient and much cleaner designs.

Most of those alternative designs have one or more flaws, or used to have in the past. The two-stroke and four-stroke engines (diesel too) are not perfect, but they don't come from random evolution. Today building hybrid engines, etc, is better, but you need technologies like supercapacitors, good batteries, ceramic inserts, good control electronics, good high-performance steel, and so on and on, that where not available in the past.


> compare to OSes - Unix died in the Unix wars and was replaced by a much worse system called windows which today has over 90% market share. Windows is by far the worst OS ever and yet this is the design that won. Technically speaking Linux today is much better and I enjoyed using it but ultimatly my main system today is windows 7 and not for technical reasons. 

The Windows95 OS may be worse, but the GUI of XP was much more refined and usable for non-guru-level users. Things are slowly changing, as Ubuntu GUI gets a bit better, it eventually will become about as good as Windows95 GUI or better :-) Most people don't care of a better kernel if the OS interface forces you to edit small text files spread everywhere that risk breaking your system at each little error :o)


> Compare to Java - a mediocre language at best yet very popular and in fact I'd prefer to use Java over D too beacuse the fact that D is a (much) better langauge is a tiny aspect of productivity of a programmer.<

Compared to D Java is also much safer than D, its compiler gives better error messages, its GCs are way better, its semantics is better defined and better enforced, HotSpot is better than even LDC with LLVM and can lead to faster programs, Java as language is simpler to learn and to use, you can run it in a browser, it's simpler to add/change parts to a Java program at runtime, its reflection is better, etc. I like D more, but Java is not bad.

Regarding Smalltalk, its syntax is weird for people that come from C/C++, its performance can't be compared to the current Java performance. I think that using txt source files, as in Java, is more compatible with the way many people have programmed. I don't believe in "idealistic pure" languages, as Smalltalk; multi-paradigm languages like D/C#/CLisp are better if you have to write real programs. To write normal non-performance critical applications today C# (mixed with few other things like C++) looks like the best language (and I think eventually in few more years it will become free enough to be usable on non Windows systems too).

Bye,
bearophile



More information about the Digitalmars-d mailing list