Re: Proficient at C



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
.



Relevant Pages

  • Re: PL/I features
    ... [Actually, the 'Checkout Compiler' was not, strictly speaking, a 'compiler. ... (really big snip) ... storage for the OS was to be 16K, with the rest of storage allocated dynamically to user programs in 4K chunks. ... FORTRAN-G was the most common FORTRAN compiler for a long time. ...
    (comp.lang.pl1)
  • Re: Help: Invalid declaration while calling C function
    ... to the Fortran program: ... > As you are using the GNU gcc compiler, I assume that your f77 compiler ... function names in a single header file and whenever a Fortran file use ...
    (comp.lang.fortran)
  • Re: Reading Fortran Data
    ... Fortran writes this as two arbitrary integers separated by a space. ... list-directed write can print results in an almost arbitrary format, ... depending on the compiler. ...
    (comp.lang.python)
  • Re: What the applications of the "procedure pointer" in F2003?
    ... (snip, someone wrote) ... Each structure contains pointers to the routine to do the actual ... That required a C compiler to be distributed ... Fortran has had the ability to pass a subroutine or function ...
    (comp.lang.fortran)
  • C <--> FORTRAN, but without ISO_C_BINDING
    ... Since the people on the Fortran ... THEN the library-path and library!! ... in my Fortran program to native Fortran types. ... or that they are compiler directives. ...
    (comp.lang.c)