Go rant

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Dec 19 19:37:39 PST 2009


retard wrote:
> Sat, 19 Dec 2009 14:04:32 -0600, Andrei Alexandrescu wrote:
> 
>> Walter Bright wrote:
>>> The Haskell folks really need to find a better canonical example.
>> Add to that the Erlang folk, too. I'm reading the book on Erlang by
>> Armstrong. Here's the Quicksort section and example on page 52:
>>
>> "Here's how to write a sort algorithm[footnote] using two list
>> comprehensions."
>>
>> The footnote says (how the hell did this make it through the editorial
>> pass???)
>>
>> "This code is shown for its elegance rather than its efficiency. Using
>> ++ in this way is not generally considered good programming practice."
>>
>> So if the code is inefficient and in poor programming practice, how in
>> this blessed world could it count as elegant?
>>
>> I have gathered a fair amount of samples of involuntary humor from that
>> book. I wouldn't want to go on about that because it could too easily be
>> interpreted as poor taste competitiveness. Let me say I don't think the
>> book is well written.
> 
> So now that you've finished writing your own book you have nothing else 
> to do but to bash all books written by users of competitive languages. 
> How low..

Well I haven't finished, and in fact I'm reading the Erlang book exactly 
to get better insight into handling concurrency via message passing.

Apparently I haven't managed to qualify my statements well enough - I 
tried to make it clear I'm not going for cheap shots, so I'm a bit 
puzzled that you fell exactly for that.

> I'm 100% sure I can find a suboptimal programming example from some C/C++/
> D book.

Yah, but that's not the one that's featured prominently as one of the 
coolest examples there is, and it wouldn't be horrendously bad. 
Virtually all introductions to FP contain this ridiculous qsort. It 
should be dipped in tar and feathers and showed around the town.

> Just like an operating system implementation book discusses Minix 
> or some educational kernel, it's not really a surprise that programming 
> books have naive examples.  I'm not really interested to hear how latest
> win7 or linux 2.6.33 kernel patch solves some SATA2 / btrfs issue when 
> reading about filesystems and buses. You should take those words about 
> relative elegance with a grain of salt. Functional code is usually less 
> verbose, less buggy, a bit less efficient due to many issues etc. These 
> are things most professionals agree with. Apparently D users need to 
> enhance their e-dick by ranting about everything that's not done in d 
> just to get a tiny bit of publicity.

I think it would grow yours to understand what functional qsort's 
problems are.

Andrei



More information about the Digitalmars-d mailing list