Basic questions about C

S

santosh

Keith said:
santosh said:
David T. Ashley wrote: [...]
Notice that data sizes are platform-dependent. This is by design.

Wasn't it the ANSI standard that did this?
[...]

No, data sizes were platform-dependent long before the ANSI standard.
There's a table of data sizes near the beginning of K&R1, published in
1978 IIRC.

Thanks. I only own the second edition of K&R. Also, I vaguely remember
reading somewhere, that at it's infancy, C's types where tied to the
PDP-11, and that it's creator never envisioned it being ported to as
many machines, as has happened. Hence my question.
 
M

Malcolm McLean

Stephen Sprunk said:
Anecdote: I once raced a guy to perform a very string-intensive task. He
wrote in Perl, I wrote in C. He finished coding in about a quarter of the
time I did, but my program still finished execution first -- by several
hours. How do you measure who won? It depends what's important, and that
varies.
I'd say Perl won.
He's in the pub drinking beers whilst you are still slaving away.

However if it becomes a thousand such tasks, then C has the advantage.
 
F

Flash Gordon

Malcolm McLean wrote, On 28/01/07 13:24:
I'd say Perl won.
He's in the pub drinking beers whilst you are still slaving away.

That all depends. Sometimes you have to stay in the office until the
program run has finished, in which case C won as he gets out first.
However if it becomes a thousand such tasks, then C has the advantage.

It does not take having to run it that often with this level of
difference in execution time.
 
R

Richard Bos

Malcolm McLean said:
I'd say Perl won.
He's in the pub drinking beers whilst you are still slaving away.

Depends. I'm an in-house programmer; I have to support my own programs.
If one of them is inefficient, that's my beer-drinking time it's eating
away, too.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,272
Latest member
MaricruzDu

Latest Threads

Top