Re: Just a bit of silliness
- From: mijoryx@xxxxxxxxx
- Date: Mon, 23 Feb 2009 21:13:31 -0800 (PST)
On Feb 23, 3:49 pm, Larry Gates <la...@xxxxxxxxxxxxxxx> wrote:
On Sat, 21 Feb 2009 03:41:06 +0000, The Hippy wrote:
Just found this on an 8 bit forum and it made me giggle
A C Man's Lament
----------------
/*
The problem I find when I'm looking at lines
Of programs all written in C
Is that the syntax and grammar resemble the stammer
Of a dyslexic demoralized bee.
I'll bet any man here (I'll wager a beer)
Can't guess how to copy a string.
The mess is dramatic, all [ "open square bracket"
. & _ ! "dot, ampersand, underscore, pling!"
Pointers collected, and thrice indirected,
Collated in structs and compiled,
When traced by debugger can make coders shudder,
And conditionals drive a man wild.
I don't wish to seem bitchy, but if only old Ritchie
Had been strangled a birth by a Nurse;
And the fate that I've planned for all Kernighan's clan
Is unprintably several times worse.
I find that the pain begins with the main(),
The only way out is to hack it.
The one bit of syntax that keeps my mind intact
Is the very last } "close curly bracket"
I hope that this ode is clearer that code
I write in that monstrosity.
You might think that Pascal's a bit of a rascal,
But the ultimate b*d is C. "b*d --> b-a star-d"
"***"
My program is calling (in structure appalling),
I must finish my poetic plea.
But, let's all face it, use Forth, LISP or BASIC,
Whatever you do, don't use C.
*/
(Translator's guide to pronunciation:
[ = open square bracket
.. = dot
& = ampersand
_ = underscore
! = pling
} = close curly bracket
* = a star)
I might be using this as a comment in all my programs from now on :)
Funny stuff. I'd never seen that before. When I started up with C
seriously a decade ago, my biggest headache was getting things printed out.
I think the table for printf conversions in K&R2 is a masterpiece in
incomprehensible brevity. Invariably, I would have to resort to asking on
usenet, with the attendant spanking machine for asking a question that
could have been deduced.
It's such a relief now to use fortran as a first means of development. No
matter what type x is,
print *, x
gives me the whole thing.
Why couldn't a C compiler "guess" what the type is, in lieu of a format
specifier?
--
larry gates
If I allowed "next $label" then I'd also have to allow "goto $label",
and I don't think you really want that... :-)
-- Larry Wall in
<1991Mar11.230002.27...@xxxxxxxxxxxxxxxxxxxxxxx>
What you appear to be wishing for is overloading.
The feature that almost makes C++ worthwhile.
The tradeoff is that the overall interface actually becomes
more complicated. You could accomplish a similar effect
with a few print-type(type x) functions to hide the
format strings. This is probably more useful for structures
than basic types.
.
- References:
- Just a bit of silliness
- From: The Hippy
- Re: Just a bit of silliness
- From: Larry Gates
- Just a bit of silliness
- Prev by Date: Re: Just a bit of silliness
- Next by Date: Re: Just a bit of silliness
- Previous by thread: Re: Just a bit of silliness
- Next by thread: ed hardy men's underwear - fashionable
- Index(es):