Re: Results of the memswap() smackdown from the thread "Sorting" assignment



Randy Howard said:

<snip>

Would you like to
know that I think /none/ of the proposed solutions should be used /as
is/ in a production application, including the one by Richard, that you
think I fawn over so much? These are minor nits, and do nothing but
get in the way of your drag race challenge, but they do exist.

Now I'm interested. What are the minor nits of which you speak?

I'll tell you one for free - the memcpy version (and I think it's fair to
say that the differences amongst the several memcpy versions have been
demonstrated to be relatively minimal, so that we can rationally discuss
them as a unit) is sensitive to overlapping blocks. The fix is to replace
the middle memcpy with a memmove. Cost: performance. Benefit: can handle
overlapping blocks. Perhaps we need to provide two versions, one "safe"
and one "fast", just like the memmove/memcpy pair.

Was that one of your nits? What are the others?

[Quoth Mr. Nilges...]

It is intellectual dishonesty of the first order to say that a
computer or programming language is the only one you'll ever need
because it can do anything. It's a salesman's claim.

I agree. Do you know of anyone that makes such a claim? If they are
around, why don't the post here so we can all laugh at them?

The F# guy springs to mind.


The question was, not whether C can memswap (by way of Turing we know
it can). It was "what is the best algorithm in abstract C, factoring
out the many different library implementations, of swapping memory?"

That question wasn't asked at all, by anyone, until right there. I see
you attempting to pick up the goal post and drag it downfield, but
apparently it's too heavy, because the goalpost is having none of it.

The goalpost has already moved from "can it be done?" to "how fast is it?".
Now, it seems, it's on its way to "what is the best algorithm?", with no
agreed definition of "best". That goalpost just fell off a cliff.

<snip>

You might note, if you took your blinders off for a second, that you're
the only one that thought the code was syntactically invalid.
Presumably because of another example of you "forgetting more about C
than anyone else has ever known"??

He is also the only one who submitted code that actually *was*
syntactically invalid, and had to be corrected before it would even
compile.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages