'Many people do not even know the grammar of the natural languages we use every 
day'

That's a curious statement. I suggest that no-one knows the grammar of say 
English in the sense that it can be stated in BNF for (most) programming 
languages, mainly because it does not exist. But then that is not usually a 
problem..

Visual Basic's continued use of with suggests it helps.

As you are implying, there are different issues for 'real' languages and those 
suitable to learn ideas of programming for novices. Lexically with simply 
removes the need to type highly qualified object/property references - which a 
professional would appreciate, with resulting clarity of expression. For a 
novice explicit references are easier to understand.

So is Groovy designed for novices learning programming concepts, or for 
professional use? I suggest it cannot be optimal for both.

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Matt Jadud
Sent: 27 April 2005 08:58
To: Russel Winder
Cc: PPIG Discuss
Subject: Re: PPIG discuss: Is there any research on...


Everything was (syntactically) a bad idea after s-expressions. The only 
mistake make the first time with LISP were the use of the mnemonics 
'car' and 'cdr'.

*cough* Sorry. That just came out.

Seriously, all syntax is hard. Many people do not even know the grammar 
of the natural languages we use every day, let alone the BNF of the 
languages they program with. Furthermore, programming languages are, 
generally speaking, expert tools. Only those blinded by experience walk 
into a classroom forgetful of what it is like to learn to program for 
the first time.

Depending on whom you believe, most studies of programming languages and 
their constructs have led to little clear understanding on the effect of 
syntax independent of a large number of other factors; Sheil, commenting 
on Sime, Green, and Guest (exploring nested IF-THEN-ELSE notation):

"
These studies make a reasonable case for the superiority of nested 
conditional structures over those using jumps. The authors explain this 
difference in terms of redundant perceptual encoding (specifically, that 
the indentation of nested programs provides a clue to their logical 
structure).
"[1]

However, that's as friendly as Sheil gets. He goes on to point out that 
"Nested languages, however, permit many variations both of indentation 
and choice of delimiters, and this factor is neither systematically 
varied nor controlled in these studies." While a rich body of work 
follows regarding notational systems, I don't expect (but would be happy 
to be surprised by) any research to exist that will directly support 
your concerns.

(I know there are others on this list who might have better literature 
to hand. It's a starting point for discussion.)

IMHO? You've added a metascope to your language; it's one thing to say

(let ([x 5]
       [y 3])
   ...
      (+ x y))

and have to know where 'x' and 'y' were bound; it is another thing 
entirely to have to remember

(with ([s (new Foo)])
   ...
     (let ([x (some-method-on-s 5)]
           [y (not-a-method-on-s 3)])
        ...
           (+ x y)))

and catch that 'some-method' is magically invoked on the object 's'. 
Then again, you might be syntactically limiting the nature of 
expressions allowable within the 'with' construct to side-effecting 
expressions on 's' that all are bound to methods of 's'; if not... yes, 
it might get confusing.

M



[1]

I don't claim this to be the best reference on this subject; it's just 
an early reference that provides a critical, and possibly unfair, review 
of the research to date (ehrm, 1981) regarding languages and the 
psychology of programming.

@article{356840,
        Address = {New York, NY, USA},
        Author = {B. A. Sheil},
        Date-Modified = {2005-04-25 00:40:39 +0100},
        Doi = {http://doi.acm.org/10.1145/356835.356840},
        Issn = {0360-0300},
        Journal = {ACM Comput. Surv.},
        Number = {1},
        Pages = {101--120},
        Publisher = {ACM Press},
        Title = {The Psychological Study of Programming},
        Volume = {13},
        Year = {1981}}


Russel Winder wrote:
> In the late 1970s early 1980s I recollect the with clause in Pascal
> causing many students learning programming great difficulties.  A number
> of languages (notably Python and Groovy) are about to introduce this
> construct and I am a bit concerned that it is a bad idea from the
> program comprehension perspective -- it also adds complexity to the
> compiler but that is not really the point.  I am wondering if there has
> been any work on the comprehension issues of with clauses or scoping and
> attribute lookup in general that might actually inform the debate (for
> Groovy anyway -- I am on the development team for this language).
> 
> Thanks.
> 
> (For those wondering what the with clause is:  The with clause is a way
> of changing the expression of binding of attributes to records or
> objects.  The sequence:
> 
>       s.foo = [ 1 , 2 , 3 ]
>       s.bar ( 4 , s.foo )
> 
> where s is some record or object reference / pointer and foo and bar are
> correctly typed attributes of the type of s can be written using a with
> clause:
> 
>       with ( s ) {
>         foo = [ 1 , 2 , 3 ]
>         bar ( 4 , foo )
>       }
> ) 
> 
 
----------------------------------------------------------------------
PPIG Discuss List ([email protected])
Discuss admin: http://limitlessmail.net/mailman/listinfo/discuss
Announce admin: http://limitlessmail.net/mailman/listinfo/announce
PPIG Discuss archive: http://www.mail-archive.com/discuss%40ppig.org/

----------------------------------------------------------------------
PPIG Discuss List ([email protected])
Discuss admin: http://limitlessmail.net/mailman/listinfo/discuss
Announce admin: http://limitlessmail.net/mailman/listinfo/announce
PPIG Discuss archive: http://www.mail-archive.com/discuss%40ppig.org/

Reply via email to