Sunday, July 21, 2019

Digest for comp.lang.c++@googlegroups.com - 2 updates in 2 topics

Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Jul 21 03:00PM +0100

https://www.youtube.com/watch?v=1t73rxE5T_I
 
Made with C++.
 
/Flibble
 
--
"Snakes didn't evolve, instead talking snakes with legs changed into
snakes." - Rick C. Hodgin
 
"You won't burn in hell. But be nice anyway." – Ricky Gervais
 
"I see Atheists are fighting and killing each other again, over who
doesn't believe in any God the most. Oh, no..wait.. that never happens." –
Ricky Gervais
 
"Suppose it's all true, and you walk up to the pearly gates, and are
confronted by God," Bryne asked on his show The Meaning of Life. "What
will Stephen Fry say to him, her, or it?"
"I'd say, bone cancer in children? What's that about?" Fry replied.
"How dare you? How dare you create a world to which there is such misery
that is not our fault. It's not right, it's utterly, utterly evil."
"Why should I respect a capricious, mean-minded, stupid God who creates a
world that is so full of injustice and pain. That's what I would say."
Jorgen Grahn <grahn+nntp@snipabacken.se>: Jul 21 11:41AM

On Wed, 2019-07-17, Alf P. Steinbach wrote:
 
> The two main problems with this function are:
 
> * Passing `value` by value may incur severe copying inefficiency.
> * The tail recursion may easily consume all stack space and yield UB.
 
It's also fairly sad and inelegant use of recursion, with the extra
cursor being passed around. The way I learned recursion, you start by
seeing an array as either empty, or having a head element, and then:
 
// vaguely Haskell-like pseudo-code
ismember(value, []) -> false
ismember(value, head:tail) -> value==head || ismember(value, tail)
 
My point is, I'm not sure the students will appreciate recursion
properly based on that code, if that's the intention. (Perhaps not
based on any C++ code.)
 
/Jorgen
 
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: