A86: Re: C compiler [OT]


[Prev][Next][Index][Thread]

A86: Re: C compiler [OT]




As it's been said before, the actual performance of the generated code
depends entirely on the compiler.  However, a language such as C will
usually produce much better code when compiled than say Pascal, Fortran or
BASIC.  When you program in C, you think about everything in terms of the
target machine, rather than in terms of itself.

That statement seems a little ambiguous, so I'll attempt to clarify it.
When you program in BASIC, you don't think about how everything will be
represented on the target machine.  You just write code and don't worry
about it.  In fact, almost every version of BASIC is interpreted.  BASIC
doesn't even have pointers!

Sure, newer implementations have different data types and allow exact data
structures just like C or Pascal.  It would be impossible to program for
something like Windows without precise data typing.  But this doesn't make
it extremely efficient, either.

When you think about an array in BASIC, what do you think of?  A list of
numbers.  What about in C?  A pointer to a statically allocated block of
memory.  Notice a differnence?

Half on the programmer, half on the language.

> There seems to be a lot of people here that know about other languages
such
> as c... Is there a compiler for c out there that is the best?  Or does
anyone
> have some strong preferences?
> Sorry i haven't said anything for a while... been out of town.
>
>



References: