Re: Pointers to "why C behaves like that ?"

"WONG SAI-KEE" <skwong@sun80.acae.cuhk.edu.hk>
15 Nov 2002 00:38:30 -0500

          From comp.compilers

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)
Re: Pointers to "why C behaves like that ?" jamesp_spam_me_not@silver-future.com (James Powell) (2002-11-17)
Re: Pointers to "why C behaves like that ?" thp@cs.ucr.edu (2002-11-17)
[63 later articles]
| List of all articles for this month |
From: "WONG SAI-KEE" <skwong@sun80.acae.cuhk.edu.hk>
Newsgroups: comp.compilers
Date: 15 Nov 2002 00:38:30 -0500
Organization: The Chinese University of Hong Kong
References: 02-11-059 02-11-071
Keywords: design
Posted-Date: 15 Nov 2002 00:38:30 EST

Gayev.D.G.=?koi8-r?Q?=3Cdg=C1ev=40mail=2Eru=3E?=@mail.rsl.ru wrote:
: WONG SAI-KEE wrote:


: Most modern languages require variables (as well as other objects) to


But, languages like HyperCard, VisualBasic (I was told) do not.


: 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.


I am not against the necessary of declaration. In some programming
books, they don't explain why we need it (or they tell a reason which
does not explain). So I'm thinking about it may be due to the
compiler construction and historical reason.


The question is: ``rather hard to do'' is not a good reason in modern
computing (in the old days, OK, due to lack of resources). Because
the compiler is written once, and all the end user benefits from it.
That should always be one of the principle of writing a computer
program: we want the computer to do the tedious labor intensive work
(of course, we need to justify the cost and benefit in some cases, but
I think the user pool is huge for a language like C to be justifiable
to provide convenience to the user).


I mean we should not sacrifice the easy of using the language due
to the compiler construction. I can understand when the author
first evolve the C lang, there are much uncertainty, so DECLARATION
is a good choice to start with. Then, this becomes the historical
reason. Other reason like unreliable is a good support, but I then
want to collect solid examples to show it in the book.


: "Technical" reasons are not less important, that the "ideological" ones.


Can you clarify this more ? Thanks.


: 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.


Thank you very much. That's a interesting site.


SK


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.