Go rant

retard re at tard.com.invalid
Sun Dec 20 11:07:32 PST 2009


Sat, 19 Dec 2009 21:29:45 -0600, Andrei Alexandrescu wrote:

> dsimcha wrote:
>> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s
>>> "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?
>> 
>> Because most functional programming purists (or, to avoid singling out
>> functional programming, purists of any single paradigm) are theory
>> weenies.  These people usually don't know an L2 cache from a floating
>> point unit.  They wouldn't grok things like implementation efficiency
>> (as opposed to algorithmic/asymptotic efficiency) or close to the metal
>> concepts if they were hit smack in the head with them.  Thus, they live
>> in paradigm land and work with theoretical models instead of real-world
>> code.
> 
> That argument doesn't hold because qsort has quadratic complexity (which
> is a theoretical thing) for a large category of inputs. Theory also has
> demonstrated that the correct choice is to randomize the pivot. So I
> don't buy it that qsort has any merit, theoretical or practical.
> 
> I think the qsort example does a lot of damage to the FP community. It's
> just lousy every way you look at it, and consider this:
> 
> 1. FP has a crushing superiority compared to all other paradigms.
> 
> 2. An FP expert could choose ANY example to illustrate said crushing
> superiority.
> 
> 3. Is qsort it?

How much faster, more elegant, or more reliable a functional programming 
needs to be in order to make joe coder use it? My impression is that joe 
often chooses the worst possible language for the task just because some 
authority tells him to. I've worked with people who favor php4 over 
everything else because php4 is the most concise, orthogonal, cost-
effective, easy to use language available to them in this world. They 
would even write their 3d engines in php if they only knew how to fill a 
triangle without leaving holes due to rounding errors or if someone told 
them how to find out if x0 is smaller than x1!



More information about the Digitalmars-d mailing list