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

thp@cs.ucr.edu
17 Nov 2002 23:20:40 -0500

          From comp.compilers

Related articles
[3 earlier articles]
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)
Re: Pointers to "why C behaves like that ?" mwotton@cse.unsw.edu.au (Mark Alexander Wolton) (2002-11-20)
Re: Pointers to "why C behaves like that ?" thp@cs.ucr.edu (2002-11-20)
Re: Pointers to "why C behaves like that ?" marcov@toad.stack.nl (Marco van de Voort) (2002-11-20)
Re: Pointers to "why C behaves like that ?" n368714668.ch@chch.demon.co.uk (Charles Bryant) (2002-11-20)
Re: Pointers to "why C behaves like that ?" peter_flass@yahoo.com (Peter Flass) (2002-11-20)
Re: Pointers to "why C behaves like that ?" peter_flass@yahoo.com (Peter Flass) (2002-11-20)
[57 later articles]
| List of all articles for this month |

From: thp@cs.ucr.edu
Newsgroups: comp.compilers
Date: 17 Nov 2002 23:20:40 -0500
Organization: University of California, Riverside
References: 02-11-059 02-11-071 02-11-083
Keywords: design
Posted-Date: 17 Nov 2002 23:20:40 EST

WONG SAI-KEE <skwong@sun80.acae.cuhk.edu.hk> wrote:
+ 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.


Python is another good example.


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


IMHO you are correct.


In the late seventies I heard a talk by Steve Johnson who (IIRC) wrote
the first portable C compiler. From what I remember of that talk, he
said that to make C more portable, they had to make it more highly
typed and "Pascal-like".


+ 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).


Agreed. It's as though the compiler is continually giving an impromptu
quizzes to the programmer, who has much better things to do with
his/her time than to tell the compiler things that it can easily
figure out for itself.


Tom Payne


Post a followup to this message

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