Re: TechNote 2106
Re: TechNote 2106
- Subject: Re: TechNote 2106
- From: Chris Page <email@hidden>
- Date: Fri, 5 Mar 2004 04:26:48 -0800
On Mar 3, 2004, at 18:57, Doug McNutt wrote:
The original property test is a clear example of a major flaw in
AppleScript. That is the allowing of multiple words in a variable
name. Essentially no other language does that. One has to use
underlines or dashes so that a variable has a single, easily parsed,
name.
I suppose this is a matter of taste, but I consider hyphens and
underlines mostly a hack to make parsing source code easier for
compiler implementors. That is, they are an unfortunate corruption of
human language that is best avoided if possible.
On the other hand, good code formatting using fonts or color can make
the boundaries of whitespace-separated phrases completely clear to
human readers, eliminating a source of potential error. AppleScript and
the existing AS editors make good use of this.
In any case, several existing programming languages do in fact allow
whitespace between words in a phrase, so AS is not alone in this. Some
use surrounding delimiters instead, e.g., vertical bars "|multiple word
name|", in order to aid in parsing for both the compiler implementor
and the human code reader.
I want more options for names in code, not less. I want solutions for
parsing and readability that involve something other than jamming plain
text characters where the spaces should be. For example, an editor that
edits programs instead of raw text could unambiguously handle
identifiers with arbitrary text in them. The text would not be parsed.
The programmer would effectively fill in forms presented by the editor,
where the editor knows what goes in each field of each form. Ideally,
this representation would be passed to the compiler and there would be
no parser at all, except for importing legacy code.
One thing that excites me about AppleScript is that it is already
almost in that state. Scripts are usually stored in compiled form, and
the editor formats the code for display to programmers. All we need now
is an editor that edits programs instead of text.
I would love to help develop such an editor, by the way (in fact, see
my .sig, hint, hint :-).
--
Chris Page - Software Wrangler - engineer for hire
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.