Related articles |
---|
Use of punctuation in a language? hsauro@cs.caltech.edu (Herbert) (2003-10-31) |
Re: Use of punctuation in a language? derkgwen@HotPOP.com (Derk Gwen) (2003-11-01) |
Re: Use of punctuation in a language? rosing@peakfive.com (MattR) (2003-11-01) |
Re: Use of punctuation in a language? gah@ugcs.caltech.edu (Glen Herrmannsfeldt) (2003-11-02) |
Re: Use of punctuation in a language? joachim.durchholz@web.de (Joachim Durchholz) (2003-11-08) |
Re: Use of punctuation in a language? bobduff@shell01.TheWorld.com (Robert A Duff) (2003-11-08) |
Re: Use of punctuation in a language? bear@sonic.net (Ray Dillinger) (2003-11-11) |
Re: Use of punctuation in a language? jcownie@etnus.com (James Cownie) (2003-11-11) |
Re: Use of punctuation in a language? landauer@got.net (Doug Landauer) (2003-11-11) |
Re: Use of punctuation in a language? Martin.Ward@durham.ac.uk (Martin Ward) (2003-11-11) |
Significant indentation joachim.durchholz@web.de (Joachim Durchholz) (2003-11-21) |
[5 later articles] |
From: | Joachim Durchholz <joachim.durchholz@web.de> |
Newsgroups: | comp.compilers |
Date: | 8 Nov 2003 01:34:07 -0500 |
Organization: | Oberberg Online Infosysteme |
References: | 03-10-129 |
Keywords: | syntax, design |
Posted-Date: | 08 Nov 2003 01:34:07 EST |
Herbert wrote:
> Does anyone have any comments on the use of punctucation is a
> language, eg, compare the following two approaches?
>
> a = 3.4; b = 6.7;
>
> or
>
> a = 3.4 b = 6.7
>
> which is better, ease of reading for humans, issues regarding design
> of compilers (eg the punctuation-less version requires
> look-ahead?). Perhaps lack of punctuation is a bad language design?
Language readability depends on many factors. Punctuation can help
structure the code. You can get away without it,but only if there are
other means that help structure the code.
For example, you can get away without semicolons for statement
separators if you use indentation and/or distinctive keywords.
Following that example further, I'd say that indentation is what most
people use to trace syntactic structure of a program at the line
level. It's somewhat unfortunate that many languages don't use
indentation to define block structure but something else ( {...} or
begin...end). On the other hand, there are problems with indentation:
tab character interpretation, various text transformations (such as
indenting when presenting code in a mail, or things that editors do
with spaces and tabs) would start to affect program structure.
In other words, what's "best" is partly a matter of commonly used
tools, partly a matter of personal taste, partly a matter of ease of
reading, and partly a matter of ease of parsing (the latter plays a
role if the compiler reports a syntax error: complicated parsing
algorithms make it harder to understand what sent the compiler into
nirwana).
Just my 5c.
Regards,
Jo
Return to the
comp.compilers page.
Search the
comp.compilers archives again.