Related articles |
---|
Pointers to "why C behaves like that ?" skwong@sun80.acae.cuhk.edu.hk (WONG SAI-KEE) (2002-11-12) |
Re: Pointers to "why C behaves like that ?" Gayev.D.G.=?koi8-r?Q?=3Cdg=C1ev=40mail=2Eru=3E?=@m (2002-11-13) |
Re: Pointers to "why C behaves like that ?" mwotton@cse.unsw.edu.au (Mark Alexander Wolton) (2002-11-15) |
Re: Pointers to "why C behaves like that ?" skwong@sun80.acae.cuhk.edu.hk (WONG SAI-KEE) (2002-11-15) |
Re: Pointers to "why C behaves like that ?" jacob@jacob.remcomp.fr (jacob navia) (2002-11-15) |
Re: Pointers to "why C behaves like that ?" christian.bau@freeserve.co.uk (Christian Bau) (2002-11-17) |
Re: Pointers to "why C behaves like that ?" Gayev.D.G.=?iso-8859-1?Q?=3Cdg=E0ev=40mail=2Eru=3E (2002-11-17) |
Re: Pointers to "why C behaves like that ?" bobduff@shell01.TheWorld.com (Robert A Duff) (2002-11-17) |
[65 later articles] |
From: | Gayev.D.G.=?koi8-r?Q?=3Cdg=C1ev=40mail=2Eru=3E?=@mail.rsl.ru |
Newsgroups: | comp.compilers |
Date: | 13 Nov 2002 12:18:15 -0500 |
Organization: | Russian state library |
References: | 02-11-059 |
Keywords: | C, design |
Posted-Date: | 13 Nov 2002 12:18:15 EST |
WONG SAI-KEE wrote:
> Why the C lang behaves like that:
> We need to delare variable in advance, in contrast to other
> lang, the program simply use without declaring it.
Most modern languages require variables (as well as other objects) to
be declared before use. There are serious reasons for. The majority
of "traditional" languages (like C, Pascal, Modulas, Ada) enforce
strict and static (e.g. compile-time) typization model. This means
compiler must know types of all program objects during
compilation. Without explicit declarations, the type assigned to
variable can only be determined by its usage - unreliable and
sometimes rather hard to do.
> Of course, there are explanation in a typical programming book for
> such issue, but most user were not convinced.
>
> I think this behaviour is related to the compiler construction
> and history reason rather than actual need.
"Technical" reasons are not less important, that the "ideological" ones.
> Is there any sites in the internet which describes why the C lang
> (or Pascal) has such such syntax ?
Look at the C creator's home page
(http://www.cs.bell-labs.com/who/dmr/). There's many interesting
documents about early C language history.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.