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

"Peter Flass" <peter_flass@yahoo.com>
20 Nov 2002 15:20:45 -0500

          From comp.compilers

Related articles
[8 earlier articles]
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)
Re: Pointers to "why C behaves like that ?" er+cc@cs.brown.edu (Manos Renieris) (2002-11-20)
Re: Pointers to "why C behaves like that ?" md9slj@mdstud.chalmers.se (Stefan Ljungstrand) (2002-11-20)
Re: Pointers to "why C behaves like that ?" torbenm@diku.dk (Torben Ægidius Mogensen) (2002-11-24)
Re: Pointers to "why C behaves like that ?" torbenm@diku.dk (Torben Ægidius Mogensen) (2002-11-24)
Re: Pointers to "why C behaves like that ?" nmm1@cus.cam.ac.uk (Nick Maclaren) (2002-11-24)
[52 later articles]
| List of all articles for this month |
From: "Peter Flass" <peter_flass@yahoo.com>
Newsgroups: comp.compilers
Date: 20 Nov 2002 15:20:45 -0500
Organization: Road Runner
References: 02-11-059 02-11-071 02-11-083 02-11-097
Keywords: design, history
Posted-Date: 20 Nov 2002 15:20:45 EST

Robert A Duff wrote:
> The reason is not historical. There are some very old languages that
> do *not* require declarations. For example, Fortran, which predates
> C, has this weird rule that the compiler should guess the type of each
> variable by looking at the first letter of its name.


This serves the same function: see a variable, know its attributes. Of
course variable types in FORTRAN were quite limited.


PL/I doesn't require declarations, since it's a two-pass compiler that
can pretty well figure out the type of a variable based on its usage
by the end of pass 1, before any code is generated.


C, being designed for a much more limited computer than PL/I, was
designed to be one-pass, which would require declarations, since it
has a larger range of data types than FORTRAN. Unfortunately once a
language gets implemented it's pretty hard to change things like this
when better hardware becomes available.


I believe (IMHO) that nowadays the consensus is that having to declare
everything is a "good thing" since it acts as a check against spelling
errors.


Post a followup to this message

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