T
Trent Buck
Quoth Gerry Quinn on or about 2004-11-12:
Perhaps I was not clear. I am not saying that a given algorithm[0]
cannot be written in C / C++. I am saying that for SOME CLASSES or
algorithm, Lisp's additional features (e.g. lexical closure) allow the
algorithm to be expressed more concisely.
If the task does not lend itself to Lisp's extra features, choice of
language is essentially a matter of personal preference.
Consider: an problem involves a large number of hierarchical datatypes.
You *could* solve the problem in C, but you'll probably think `Aha! This
is an OO-type problem. They are easier to code in C++ than C.' But if
your coprogrammers were unfamiliar with C++ (and OO), they'd probably
try to write C++ code as if it were C, and complain loudly about all the
extra type-checking[1].
-trent
[0] Anything expressible as an algorithm is expressible in Turing
machine language. (Church/Turing thesis)
[1] *I* certainly did this two years ago, before I learnt C++.
But there are no *tasks* fitting that description (hello, Turing-
complete).
Perhaps I was not clear. I am not saying that a given algorithm[0]
cannot be written in C / C++. I am saying that for SOME CLASSES or
algorithm, Lisp's additional features (e.g. lexical closure) allow the
algorithm to be expressed more concisely.
If the task does not lend itself to Lisp's extra features, choice of
language is essentially a matter of personal preference.
Consider: an problem involves a large number of hierarchical datatypes.
You *could* solve the problem in C, but you'll probably think `Aha! This
is an OO-type problem. They are easier to code in C++ than C.' But if
your coprogrammers were unfamiliar with C++ (and OO), they'd probably
try to write C++ code as if it were C, and complain loudly about all the
extra type-checking[1].
-trent
[0] Anything expressible as an algorithm is expressible in Turing
machine language. (Church/Turing thesis)
[1] *I* certainly did this two years ago, before I learnt C++.