Basic bits operation

D

Dan Henry

Dan Henry said:


It will take more than an XOR to derail Richard Bos.
...

FWIW I had no problem reading your expression (although I must admit I
prefer foo == 0 to !foo). Nor did Richard Bos - you can be sure of
that. He rightly enjoys a great deal of respect in this newsgroup for
his C knowledge, and would have had no trouble working out what your
code means. He just didn't think it was as self-evident as the code
that preceded it in the thread.

For the sake of accuracy, the phrase he used was "It's highly
unclear..."

FWIW, I've been reading c.l.c for an embarrassingly long time, so I am
not ignorant regarding current participants' level of respect amongst
their peers. I am even aware that there were other knowledgeable
folks that have come and gone before Mr. Bos and some others of the
current crew came on the scene.
 
D

Dan Henry

I liked your ^ expresssion good enough.
It had a thoughtful comment about speed to go with it.

That was the OP's criterion ("efficient" actually, not speed). I
presented something different and from the very start advised the OP
to test it. The OP never even defined what he considered efficient;
fewer instructions, faster execution, typing economy, etc.

Anyway, Mr. Bos comes back to me with this bit: "_If_ you can show
that the program is unacceptably slow with Ian's version, and fast
enough with yours, then I'd still first look for a better algorithm;
and only if that cannot be found, I'd use your version, and add a big
comment explaining why I didn't use the obvious code."

As if to say: "Ugh! What a highly unclear, utterly vile little
expression you've come up with Mr. Henry. Prove to me it might be
faster on the OP's unstated architecture and toolchain, then I'll be
motivated to do you one better and if I can't and am forced to
actually use your putrid expression, I'll have to add a big comment
explaining my duress."

To me, that seemed an extreme reaction to and awfully tame expression.
I am pleased that you weren't so put off by it.
 
R

Richard Heathfield

Dan Henry said:
[Richard Bos] just didn't think it was as self-evident as the code
that preceded it in the thread.

For the sake of accuracy, the phrase he used was "It's highly
unclear..."

For the sake of even more accuracy, the phrase he used was "It's highly
unclear compared [to] Ian's", which is a rather different claim.

<snip>
 
I

Ian Collins

Richard said:
Dan Henry said:
[Richard Bos] just didn't think it was as self-evident as the code
that preceded it in the thread.
For the sake of accuracy, the phrase he used was "It's highly
unclear..."

For the sake of even more accuracy, the phrase he used was "It's highly
unclear compared [to] Ian's", which is a rather different claim.
Goodness me, this thread is still going!

What are you doing working nights?
 
D

Default User

pete said:
My posts that I have discarded before sending, oh boy, oh boy...

Sometimes it's helpful, like the old thing about writing exactly how
you feel in a letter to someone, then tearing it up rather than send it.



Brian
 
K

Keith Thompson

Default User said:
Sometimes it's helpful, like the old thing about writing exactly how
you feel in a letter to someone, then tearing it up rather than send it.

The trick is to avoid sending it. Accidentally hitting the "send"
button (control-c control-c in my newsreader) is a lot easier than
accidentally putting a letter in an envelope, sealing it, putting a
stamp on it, and dropping it in a mailbox.
 
C

CBFalconer

Keith said:
The trick is to avoid sending it. Accidentally hitting the "send"
button (control-c control-c in my newsreader) is a lot easier than
accidentally putting a letter in an envelope, sealing it, putting
a stamp on it, and dropping it in a mailbox.

I have a 'draft' directory, and the reader can dump anything in
there in place of sending (or destruction). Very handy for cooling
off. Their usual fate is destruction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top