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

"Robert A Duff" <bobduff@shell01.TheWorld.com>
17 Nov 2002 23:18:32 -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)
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)
[59 later articles]
| List of all articles for this month |

From: "Robert A Duff" <bobduff@shell01.TheWorld.com>
Newsgroups: comp.compilers
Date: 17 Nov 2002 23:18:32 -0500
Organization: The World Public Access UNIX, Brookline, MA
References: 02-11-059 02-11-071 02-11-083
Keywords: design, comment
Posted-Date: 17 Nov 2002 23:18:32 EST

"WONG SAI-KEE" <skwong@sun80.acae.cuhk.edu.hk> writes:


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


Languages should be designed primarily for the human reader.
Declarations make programs easier to understand, presuming you are
declaring useful information (useful to the human reader).


Somebody mentioned type inference in ML. My opinion is: it's nice
*within* a single function, but the *interfaces* to pieces of software
ought to have *explicit* declarations of types, so I can understand
them without reading all the code.


> 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 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. Of course,
Fortran has come a long way since those days. Remember the old joke
about how we don't know what programming language we'll be using in
2050, but it will be called "FORTRAN"?


- Bob
[That was one of Alan Perlis' quips. Maybe he was wrong and it'll be
called C+++++++++++. -John]


Post a followup to this message

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