Re: Segfault City
- From: Andrew Poelstra <apoelstra@xxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 24 Jun 2006 17:12:57 GMT
On 2006-06-24, spinoza1111@xxxxxxxxx <spinoza1111@xxxxxxxxx> wrote:
Andrew Poelstra wrote:
On 2006-06-24, Richard Heathfield <invalid@xxxxxxxxxxxxxxx> wrote:
[X-posted, and followups set]
I found something interesting on the Web today, purely by chance.
Just out of curiousity, did you stumble upon that while Googling your own
name? I'm not accusing you of arrogance, but it's interesting that he
mentions and insults you specifically in his preamble.
It would be funny if it weren't so sad. Or sad if it weren't so funny. I'm
not sure which.
http://www.developerdotstar.com/community/node/291
This "teacher of C" demonstrates his prowess with a masterful display of
incompetence in a 200-line program that travels as swiftly as possible to
Segfault City.
Ooh. Segfault City. Where all bad programs go to die. :-)
(Actually, using my normal gcc switches, it doesn't even get past TP3, but
it will at least compile if you just use gcc -o foo foo.c, after hacking it
around a bit to do things like mending the line-spanning single-line
comments and string literals, which - in fairness to the author - are
probably an artifact of the Webification of the code.)
I wonder how long I'll take to stop laughing.
I stopped reading after the first function. I wasn't sure why he kept
Which disqualifies you from a technical discussion. Why are you
posting?
How does that disqualify me? I read through an entire function that could be
replaced with... let's see... 4 characters: -'0'. That's a lot more tolerance
than a lesser programmer might have. Why on earth would you use a function at
all?
What is simpler?
n = c - '0';
or
n = char2digit (c);
The former is a well-known construct. The latter is a function call that looks
exactly like any other function. One of them I can glance over and see what it
does, while the other requires me to stop and look.
They both require checks if you want to ensure that c is a digit. It's just
that's one's shorter, simpler and more efficient.
So, the question now seems, why are /you/ posting?
casting chars to ints, as though there wasn't implicit casting going on
by default. Then he tested for > '9', which made no sense to me. Realizing
that I wouldn't be able to trace that logic, I stopped.
It was a straightforward test for numerics. Again, are you qualified to
be in this discussion?
You stopped trying to understand things twice, so your opinion is
worth...what?
See above. I eventually realized that I would have to just rewrite the code to
have any hope of reading it. Your overly-long variable names, unnecessary casts,
useless functions, Hungarian notation, overly-spaced parentheses, and use of //
comments just didn't seem worth trying to understand.
What, if anything, can it be guaranteed will be > '9' in standard C?
This isn't grammatical therefore I do not fully understand it. If you
are saying there is no character greater than 9, well I wish you all
the best in your future career. You'll need it.
Don't quote signatures. You've been doing that all thread, and it's getting
annoying. My question was perfectly grammatical. Perhaps you should have
studied English more in high school.
In fact, there /isn't/ any guarantee of a character greater than '9' in C.
I would think that since I understand the C standard far better than you,
perhaps /I/ should be wishing /you/ the best on your future career.
--
Andrew Poelstra < http://www.wpsoftware.net/blog >
To email me, use "apoelstra" at the above address.
I know that area of town like the back of my head.
.
- Follow-Ups:
- Re: Segfault City
- From: spinoza1111
- Re: Segfault City
- From: Malcolm
- Re: Segfault City
- From: Richard Heathfield
- Re: Segfault City
- References:
- Re: Segfault City
- From: Andrew Poelstra
- Re: Segfault City
- From: spinoza1111
- Re: Segfault City
- Prev by Date: Re: coderwiki.com is starting and needs you!
- Next by Date: Re: Segfault City
- Previous by thread: Re: Segfault City
- Next by thread: Re: Segfault City
- Index(es):
Relevant Pages
|