[REBOL] Re: Using Switch with Words ??/C/C++
From: joel:neely:fedex at: 1-Nov-2001 11:28
Hi, Tim,
I'll plead to a bit of stress-relief humor on this one...
Tim Johnson wrote:
> > Given that the same thing can be coded in C as
> >
> > printf "%d\n", value;
> >
> > it's easy to see what an improvement C++ is... ;-)
>
> That's arguable.... :>) case-by-case basis.
>
I was just taking a good-humored poke (at least I *HOPE* it came
across as good humor) at the fact that
> C++:
>
> switch(value) {
> case 1 :
> cout << value << endl;
> break;
>
> case 2 :
> cout << value << endl;
> break;
>
> default :
> cout << value << endl;
> }
is actually doing exactly the same thing in all cases, and is
therefore equivalent to
cout << value << endl;
(but I couldn't resist writing a C version that's exactly one
keystroke shorter! ;-)
> Joel, if you don't teach you should. You would be
> wonderful at it.
>
Thank you! Given that teaching/communicating/thinking/designing
are essentially inseparable concepts to me, I'll take that as
a compliment! (I actually have 12 years' experience teaching
Math and Computing Science in higher education, but I'm not making
my living that way now.)
-jn-
--
This sentence contradicts itself -- no actually it doesn't.
-- Doug Hofstadter
joel<dot>neely<at>fedex<dot>com