Re: Proficient at C
- From: Richard Heathfield <rjh@xxxxxxxxxxxxxxx>
- Date: Thu, 12 Jun 2008 01:06:01 +0000
Paul Hsieh said:
On Jun 11, 9:25 am, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
Paul Hsieh said:
<snip>
<main>
Whatever your compiler accepts is good enough,
Much laughing. So a Fortran program is good enough, provided you're using
a compiler that accepts Fortran? I Don't Think So.
Which of the options listed (that you have deleted from the thread, of
course)
The deletion is not malicious. We both know what we're talking about.
do you think a Fortran compiler will accept?
Well, gcc will accept several of them, and that's a Fortran compiler, right?
Once you step outside the rules of C, you're not really testing C knowledge
any more.
and if another doesn't this couldn't be more than a 10 second
fix. There are cases where being pedantic about the standard is so
truly and utterly useless. This is one of of those cases.
Portability has its benefits, whether you realise it or not.
*Cough* straw man *cough*.
Not at all. You claim that this whole main() thing is one of the cases where
being pedantic about the Standard is truly and utterly useless, whereas in
fact it's one of those cases where knowing the language spec allows you to
write a maximally portable entry point for your program - so as far as I can
see, your claim is simply wrong. Not a strawman in sight.
<casting malloc>
However, if you have a candidate that insists
that putting this cast is a bad idea, you should probably consider
walking the candidate out immediately.
If you insist on disagreeing with the candidate, then yes, of course,
thank him for his time and let him go - there's no point hiring a bright
guy if you're not going to listen to him.
"Bright guys" besides being a subjective turn,
And "ideologue" isn't?
<snip>
(Obviously we can't expect a perfect job in five minutes,
int floodfill (gfx_fb *fb, size_t x, size_t y, unsigned long colour) {
int counter;
unsigned long currentColor;
if (NULL == fb || x < 0 || y < 0
Two wasted tests. x and y are unsigned types.
You have to be kidding me. There is a *GARGANTUAN* amount of waste in
my routine, even ignoring the recursion, and you managed to isolate
the most irrelevant?
You mentioned all the others yourself, right? So what's the point in telling
you about those?
(And if you look again, it does appear to be
*three* wasted tests, as fb cannot spontaneously become NULL as it
gets passed recursively.)
Well, it's not wasted on the *first* call. (The fix is obvious.)
<snip>
You have a bizarre sense of priority.
I think it's very, very fortunate that we don't work at the same place. We'd
drive each other nuts within a week.
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.
- Follow-Ups:
- Re: Proficient at C
- From: Serve Lau
- Re: Proficient at C
- References:
- Proficient at C
- From: jaysome
- Re: Proficient at C
- From: Richard Heathfield
- Re: Proficient at C
- From: Paul Hsieh
- Re: Proficient at C
- From: Richard Heathfield
- Re: Proficient at C
- From: Paul Hsieh
- Proficient at C
- Prev by Date: Re: Bug/problem with lcc-win - TPA
- Next by Date: Re: Question
- Previous by thread: Re: Proficient at C
- Next by thread: Re: Proficient at C
- Index(es):
Relevant Pages
|