Re: problems with identifiers and keywords...

Martin Ward <Martin.Ward@durham.ac.uk>
19 Nov 2004 00:55:19 -0500

          From comp.compilers

Related articles
[12 earlier articles]
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-17)
Re: problems with identifiers and keywords... lkrupp@pssw.NOSPAM.com.INVALID (Louis Krupp) (2004-11-17)
Re: problems with identifiers and keywords... cfc@shell01.TheWorld.com (Chris F Clark) (2004-11-17)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-11-19)
Re: problems with identifiers and keywords... gah@ugcs.caltech.edu (glen herrmannsfeldt) (2004-11-19)
Re: problems with identifiers and keywords... gracjan@acchsh.nospam.com (Gracjan Polak) (2004-11-19)
Re: problems with identifiers and keywords... Martin.Ward@durham.ac.uk (Martin Ward) (2004-11-19)
Re: problems with identifiers and keywords... Peter_Flass@Yahoo.com (Peter Flass) (2004-11-20)
Re: problems with identifiers and keywords... genew@mail.ocis.net (Gene Wirchenko) (2004-11-20)
Re: problems with identifiers and keywords... david.thompson1@worldnet.att.net (Dave Thompson) (2004-11-28)
Re: problems with identifiers and keywords... cgweav@aol.com (2004-11-29)
Re: problems with identifiers and keywords... nmm1@cus.cam.ac.uk (2004-12-01)
Re: problems with identifiers and keywords... cdc@maxnet.co.nz (Carl Cerecke) (2004-12-01)
[2 later articles]
| List of all articles for this month |

From: Martin Ward <Martin.Ward@durham.ac.uk>
Newsgroups: comp.compilers
Date: 19 Nov 2004 00:55:19 -0500
Organization: Compilers Central
References: 04-10-148 04-11-031 04-11-052
Keywords: syntax, design
Posted-Date: 19 Nov 2004 00:55:19 EST

On Wednesday 17 Nov 2004 4:36 pm, you wrote:
> I am not sure I agree with this. Human languages are fairly hard
> for machines to parse, yet presumably designed for humans to
> understand. In a large number of cases, I don't believe humans have
> problems with keywords used as identifiers,


Humans very rarely use keywords as identifiers: how many (English)
people do you know who are called "The" or "And"?
"Pass me the the will you, And?" is not immediately obvious.


More seriously, humans are good at pattern matching: with a small
number of keywords (and properly indented code) a human can pick out
the keywords instantly and work out the overall structure of a chunk
of code very quickly. When keywords are also used as identifiers,
this is not possible.


So the real solution to the problem of lots of keywords (where a
programmer might use an unfamiliar keyword as an identifier) is simply
to define fewer keywords and *not* to use unique keywords for rarely
used constructs in the language.
--
Martin


Martin.Ward@durham.ac.uk http://www.cse.dmu.ac.uk/~mward/ Erdos number: 4
[Someone else wrote in asking "Who's on first?" -John]



Post a followup to this message

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