C++ vs Lisp

Georg Wrede georg at nospam.org
Wed Jun 11 02:55:08 PDT 2008


Robert Fraser wrote:
> Walter Bright wrote:
> 
>> An oldie, but some very thought provoking observations on what
>> makes a language productive:
>> 
>> http://faculty.cs.byu.edu/~irenelg/courses/330/CTM/Resources/C++-vs-Lisp.txt
>> 
> 
> Concise does not always mean readable, and reducing lines of code
> should *never* be a design goal.

Correct!

> For example, if I removed many temporary variables and used long
> expressions (as is the style in many functional languages), I could
> probably chop off 1/5-1/4 of the LOC of my program, but
> debugging/fixing it would get much harder. Additionally, redundancy 
> (as stated in the ";" topic) is not necessarily a bad thing as it
> helps reinforce meaning to readers.

Too concise and non-redundant, and it becomes inintelligible.

As an example, I looked up the Idiom Library by the Finnish 
APL-Association, (ISBN 951-95886-0-4), Helsinki 1984, in my bookshelf. 
Here's a routine that removes duplicate entries from an array:

(1 1Q<\Xo.=X)/X

And this is from the easy side.

Of course, having a language where you can write a 20 page D program in 
25 lines is nice and all. But debugging this stuff is way harder than 
debugging old Perl programs. The word Nightmare doesn't even begin to 
describe it. Anything you've written more than two days ago, you simply 
can't debug. You have to rewrite it. But what if it took ten days to 
write in the first place?

The other option would be to splash comments all over the place, but 
then the stuff becomes just as long as D, and we all know how up-to-date 
the comments will be in reality. (And yes, I was impressed with the 
language for a month, but then using it for real started to turn my 
stomach.)



More information about the Digitalmars-d mailing list