Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!gatech!swrinde!howland.reston.ans.net!ix.netcom.com!netcom.com!NewsWatcher!user
From: demars@netcom.com (Dennis D.)
Subject: Re: dot syntax confusion
Message-ID: <demars-1302962053390001@10.0.2.15>
Sender: demars@netcom5.netcom.com
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
X-Newsreader: Yet Another NewsWatcher 2.0.3b0
References: <9602031834.aa29300@ax433.mclink.it>
Date: Wed, 14 Feb 1996 04:53:38 GMT
Lines: 63

In article <9602031834.aa29300@ax433.mclink.it>, MC8531@mclink.it (Enrico
Colombini) wrote:

>It could be that I have at last understood why I don't like the dot
>syntax for slot access in Dylan, despite having used it extensively
>in C++ over the years.
>
>I find no problem in reading expressions such as:
>
>  window.title.position
>
>I find no problem either, despite my initial doubts, in reading
>Lisp-style names including a dash:
>
>  first-window
>
>Spaces (or other separators) around the name help avoiding
>misreading the dash as a minus sign.
>
>My problem, a readability problem, arises when I see something
>like this (quite common in everyday Dylan programming):
>
>  first-window.main-title.old-position
>
>I have been long uncomfortable with such expressions, without
>being able to understand why. Then, a few days ago, I realized
>that my built-in C++ parser is constantly trying to read the
>above line this way:
>
>  first - window.main - title.old - position
>

I don't think the problem is the dot notation, but the decision to allow
"-" in indentifiers. This is one of several notational decisions that make
Dylan an rather homely language. I guess the problem is, the convention of
using a hyphen in indentifiers is common in Lisp, where it doesn't cause a
problem because it's not an infix notation. But no infix languages I know
of allow this. Of course most of them can't since they generally don't
require spaces around infix operators, as Dylan does.

I see several other messages in this thread that claim if you put spaces
around your pluses and minuses (as all good little boys and girls should)
then the hyphenated identifiers are perfectly readable. Well, if you say
so, but all I can say is that this has not been my experience. I _always_
put spaces around these operators, and most code I see does likewise, yet
in many Dylan expressions I _still_ keep confusing the hyphen for a minus
sign in many cases.

What should have been done (IMO) is to exclude this (and probably all
other arithmetic operators) from the identifier character set. I feel the
underscore is a perfectly acceptable substitute for the hyphen and is more
readable. Of course, it is far too late for this as the hyphen is not only
allowed in identifiers but the language designers proceded to use it in
every predefined keywork they possibly could, sometimes a couple of
hyphens in one keyword if they could possibly fit them in.

Well, there's bound to be a difference of opinion on this point, but I
think Dylan's got some readability problems. Of course, a programming
language doesn't necessarily have to be highly readable to be successful
(e.g. C++) but it sure wold be nice if we could learn a few things from
past experience.

- Dennis D.
