NetRexx enhancements: multiple assignments and new assign opserators

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

NetRexx enhancements: multiple assignments and new assign opserators

Thomas.Schneider.Wien
  Hello there,
    I would like to discuss the idea to enhance the assignment statement
as follows:.

e.g.:

    a=x -- already there

1.) enhanced assignment operators:

proposed new syntax (as in ooRexx 4.0):

    a += b
    a -=  b

     etc ...

i.e. the equal sign may be preceeded by an operator, as in other
languages. (even PL/I does now support this syntax, originally invented
for C, I think)

2.) multiple assignment syntax:

The comma may be used on the left hand side of an assignment to separate
a list of variables. :

    i, ,j,k = int 0 -- indices, for instance

    m,n += 3 -- increase m and n by 3

Would make programs much shorter.

I just implemented a trial version in my own Parser, but would propose
this for
NetRexx3 as well.

Note: Also, PL/I does support this syntax.

Any objections?

Thomas Schneider (Tom)

--
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)
Reply | Threaded
Open this post in threaded view
|

RE: NetRexx enhancements: multiple assignments and newassign opserators

Mike Cowlishaw
The objection is the usual one.  Every time you add a new special syntax you
make programs less easy to read/understand for the occasional programmer.  

The net effect is that you save a few keystrokes for the experienced programmer
(who is probably a faster typist anyway) and the expense of making programs more
inscrutable for the less experienced, or new, programmer.

[I agree that 'a+=1' is handy.  However, a shorter syntax might be possible:
'a+1' (the first symbol is assumed to be the recipient).  a++, however, is pure
jargon.  Commas on the left of = really don't save much, especially in a
language where 0 is the default initializer, and discourage people from
documenting their variables.]

Mike

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of
> Thomas Schneider
> Sent: 23 September 2010 11:35
> To: IBM Netrexx
> Subject: [Ibm-netrexx] NetRexx enhancements: multiple
> assignments and newassign opserators
>
>   Hello there,
>     I would like to discuss the idea to enhance the
> assignment statement as follows:.
>
> e.g.:
>
>     a=x -- already there
>
> 1.) enhanced assignment operators:
>
> proposed new syntax (as in ooRexx 4.0):
>
>     a += b
>     a -=  b
>
>      etc ...
>
> i.e. the equal sign may be preceeded by an operator, as in
> other languages. (even PL/I does now support this syntax,
> originally invented for C, I think)
>
> 2.) multiple assignment syntax:
>
> The comma may be used on the left hand side of an assignment
> to separate a list of variables. :
>
>     i, ,j,k = int 0 -- indices, for instance
>
>     m,n += 3 -- increase m and n by 3
>
> Would make programs much shorter.
>
> I just implemented a trial version in my own Parser, but
> would propose this for
> NetRexx3 as well.
>
> Note: Also, PL/I does support this syntax.
>
> Any objections?
>
> Thomas Schneider (Tom)
>
> --
> Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
>

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and newassign opserators

Fernando Cassia-2
On Thu, Sep 23, 2010 at 10:45 AM, Mike Cowlishaw <[hidden email]> wrote:
> The objection is the usual one.  Every time you add a new special syntax you
> make programs less easy to read/understand for the occasional programmer.
>
> The net effect is that you save a few keystrokes for the experienced programmer
> (who is probably a faster typist anyway) and the expense of making programs more
> inscrutable for the less experienced, or new, programmer.

I wholeheartedly support Mike´s view.
For heaven´s sake please stop thinkering with programming languages´
syntax just trying to be clever.

I was dismayed to see the abuse of curly braces in JavaFX, for instance.

http://refactorama.blogspot.com/2008/05/javafx-curly-brace-overdose.html
FC

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and new assign opserators

Aviatrexx
In reply to this post by Thomas.Schneider.Wien
Tom,

I don't think u fully apprct t vlu o clrt NTM sntx rrr-chkng bkwds
cmptblt & ftr lngg xtnsns whn u prps sch "nhncmnts" 2 NR IMO.

[No doubt you were able to eventually able to understand that
sentence, but I made you work for it, didn't I?  Why?  So I could save
a couple of keystrokes.]

None of your "enhancements" add anything to the language.  Worse yet,
such supererogatory syntax could close the door on other language
changes which might be necessary/desirable in the future.  Because
NetRexx is very dependent on Java features (which seem to change with
the seasons) this is not a minor consideration.

The fact that PL/I and ooRexx have incorporated C syntax has more to
do with the pervasion of perversion, IMHO.

When it comes to teaching programming languages, I can assure you that
simplicity, clarity, and consistency are the most important
characteristics of an easy-to-learn, -use, and -remember language syntax.

Not saving keystrokes.

-Chip-

On 9/23/10 10:34 Thomas Schneider said:

>  Hello there,
>    I would like to discuss the idea to enhance the assignment statement
> as follows:.
>
> e.g.:
>
>    a=x -- already there
>
> 1.) enhanced assignment operators:
>
> proposed new syntax (as in ooRexx 4.0):
>
>    a += b
>    a -=  b
>
>     etc ...
>
> i.e. the equal sign may be preceeded by an operator, as in other
> languages. (even PL/I does now support this syntax, originally invented
> for C, I think)
>
> 2.) multiple assignment syntax:
>
> The comma may be used on the left hand side of an assignment to separate
> a list of variables. :
>
>    i, ,j,k = int 0 -- indices, for instance
>
>    m,n += 3 -- increase m and n by 3
>
> Would make programs much shorter.
>
> I just implemented a trial version in my own Parser, but would propose
> this for
> NetRexx3 as well.
>
> Note: Also, PL/I does support this syntax.
>
> Any objections?
>
> Thomas Schneider (Tom)
>
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and new assign opserators

Fernando Cassia-2
On Thu, Sep 23, 2010 at 3:58 PM, Chip Davis <[hidden email]> wrote:

> The fact that PL/I and ooRexx have incorporated C syntax has more to do with
> the pervasion of perversion, IMHO.

HA-HA you made me spill my coffee...

> When it comes to teaching programming languages, I can assure you that
> simplicity, clarity, and consistency are the most important characteristics
> of an easy-to-learn, -use, and -remember language syntax.
>
> Not saving keystrokes.

I will print this, no, wait, I´ll engrave this in stone and hang it on a wall.

Will you run for office? I´d certainly vote for you.

In other words, why is common sense so uncommon as of late?. :)

FC

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and new assign opserators

Thomas.Schneider.Wien
In reply to this post by Aviatrexx
  Hello Chip,
    thanks for the Gryphs ;-)

My point is:

When members of REXXLA currently DO change between ooRexx and NetRexx,
they always will have to be aware of the syntax incompatibilities .....

i.e.:
     a += 1
is nowadays supported by ooRexx, but *not* by Netrexx!

Full stop.
Thomas.

sopeople are
Am 23.09.2010 20:58, schrieb Chip Davis:

> Tom,
>
> I don't think u fully apprct t vlu o clrt NTM sntx rrr-chkng bkwds
> cmptblt & ftr lngg xtnsns whn u prps sch "nhncmnts" 2 NR IMO.
>
> [No doubt you were able to eventually able to understand that
> sentence, but I made you work for it, didn't I?  Why?  So I could save
> a couple of keystrokes.]
>
> None of your "enhancements" add anything to the language.  Worse yet,
> such supererogatory syntax could close the door on other language
> changes which might be necessary/desirable in the future.  Because
> NetRexx is very dependent on Java features (which seem to change with
> the seasons) this is not a minor consideration.
>
> The fact that PL/I and ooRexx have incorporated C syntax has more to
> do with the pervasion of perversion, IMHO.
>
> When it comes to teaching programming languages, I can assure you that
> simplicity, clarity, and consistency are the most important
> characteristics of an easy-to-learn, -use, and -remember language syntax.
>
> Not saving keystrokes.
>
> -Chip-
>
> On 9/23/10 10:34 Thomas Schneider said:
>>  Hello there,
>>    I would like to discuss the idea to enhance the assignment
>> statement as follows:.
>>
>> e.g.:
>>
>>    a=x -- already there
>>
>> 1.) enhanced assignment operators:
>>
>> proposed new syntax (as in ooRexx 4.0):
>>
>>    a += b
>>    a -=  b
>>
>>     etc ...
>>
>> i.e. the equal sign may be preceeded by an operator, as in other
>> languages. (even PL/I does now support this syntax, originally
>> invented for C, I think)
>>
>> 2.) multiple assignment syntax:
>>
>> The comma may be used on the left hand side of an assignment to
>> separate a list of variables. :
>>
>>    i, ,j,k = int 0 -- indices, for instance
>>
>>    m,n += 3 -- increase m and n by 3
>>
>> Would make programs much shorter.
>>
>> I just implemented a trial version in my own Parser, but would
>> propose this for
>> NetRexx3 as well.
>>
>> Note: Also, PL/I does support this syntax.
>>
>> Any objections?
>>
>> Thomas Schneider (Tom)
>>
> _______________________________________________
> Ibm-netrexx mailing list
> [hidden email]
>
>


--
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)
Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and newassign opserators

Thomas.Schneider.Wien
In reply to this post by Mike Cowlishaw
  Hi Mike,
    thanks for your reply.

I would, however, like to keep this discussion open for a while.

For anybody programming ONLY in NetRexx, you are right, of course.

For anybody *switching* between languages a LOT, and also for Java
Programmers, you are wrong.

I did present Netrexx to some Java Programmers here in Austria, and some
replies of course, have been:  why the hell can I not use the notation I
am used to use.

On the use of commas on the left side of a decl/assignment.

i,j,k = int 0 -- indices
ii,jj,kk = int 0 -- item numbers

w1,w2,w3 = Rexx ''  --blank delimited WordLists

Is a very understandable notation, and shortens the process
for documenting the program!

Tom.

PS: I even copy the 'line-note' (the last Note/Remark in the line, as I
call it,
to the internal declarations file I'm using)

Let's discuss this a bit further, please!

=========================================================
Am 23.09.2010 15:45, schrieb Mike Cowlishaw:

> The objection is the usual one.  Every time you add a new special syntax you
> make programs less easy to read/understand for the occasional programmer.
>
> The net effect is that you save a few keystrokes for the experienced programmer
> (who is probably a faster typist anyway) and the expense of making programs more
> inscrutable for the less experienced, or new, programmer.
>
> [I agree that 'a+=1' is handy.  However, a shorter syntax might be possible:
> 'a+1' (the first symbol is assumed to be the recipient).  a++, however, is pure
> jargon.  Commas on the left of = really don't save much, especially in a
> language where 0 is the default initializer, and discourage people from
> documenting their variables.]
>
> Mike
>
>> -----Original Message-----
>> From: [hidden email]
>> [mailto:[hidden email]] On Behalf Of
>> Thomas Schneider
>> Sent: 23 September 2010 11:35
>> To: IBM Netrexx
>> Subject: [Ibm-netrexx] NetRexx enhancements: multiple
>> assignments and newassign opserators
>>
>>    Hello there,
>>      I would like to discuss the idea to enhance the
>> assignment statement as follows:.
>>
>> e.g.:
>>
>>      a=x -- already there
>>
>> 1.) enhanced assignment operators:
>>
>> proposed new syntax (as in ooRexx 4.0):
>>
>>      a += b
>>      a -=  b
>>
>>       etc ...
>>
>> i.e. the equal sign may be preceeded by an operator, as in
>> other languages. (even PL/I does now support this syntax,
>> originally invented for C, I think)
>>
>> 2.) multiple assignment syntax:
>>
>> The comma may be used on the left hand side of an assignment
>> to separate a list of variables. :
>>
>>      i, ,j,k = int 0 -- indices, for instance
>>
>>      m,n += 3 -- increase m and n by 3
>>
>> Would make programs much shorter.
>>
>> I just implemented a trial version in my own Parser, but
>> would propose this for
>> NetRexx3 as well.
>>
>> Note: Also, PL/I does support this syntax.
>>
>> Any objections?
>>
>> Thomas Schneider (Tom)
>>
>> --
>> Thomas Schneider Projects ReyC&  LOGOS on www.KENAI.com
>> _______________________________________________
>> Ibm-netrexx mailing list
>> [hidden email]
>>
>


--
Thomas Schneider Projects ReyC & LOGOS on www.KENAI.com
_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Tom. (ths@db-123.com)
Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and new assign opserators

alansam
In reply to this post by Aviatrexx


On 23 September 2010 11:58, Chip Davis <[hidden email]> wrote:
Tom,

I don't think u fully apprct t vlu o clrt NTM sntx rrr-chkng bkwds cmptblt & ftr lngg xtnsns whn u prps sch "nhncmnts" 2 NR IMO.


Nice one :-D
 
None of your "enhancements" add anything to the language.  Worse yet, such supererogatory syntax could close the door on other language changes which might be necessary/desirable in the future.  Because NetRexx is very dependent on Java features (which seem to change with the seasons) this is not a minor consideration.

The fact that PL/I and ooRexx have incorporated C syntax has more to do with the pervasion of perversion, IMHO.

 
To be fair though;  Java does provide the syntactic sugar of +=, *=, %=, ++, -- etc. along with the: a = b = c = d; (and even: a /= b += c *= d;) assignment constructs.  Notwithstanding that, I agree with you that NetRexx's simplicity is a major part of it's appeal and beauty.

Alan.
--
Can't tweet, won't tweet!

_______________________________________________
Ibm-netrexx mailing list
[hidden email]

Alan

--
Needs more cowbell.
Reply | Threaded
Open this post in threaded view
|

Re: NetRexx enhancements: multiple assignments and newassign opserators

Tom Maynard
In reply to this post by Thomas.Schneider.Wien
  On 9/23/2010 2:44 PM, Thomas Schneider wrote:
>
> I would, however, like to keep this discussion open for a while.
>
I write code in the Spin language for the Parallax Propeller
microcontroller.  Spin has extended the binary operator set to include
all manner of assignments, e.g.

/= divide; //= modulus; #>= limit minimum; <#= limit maximum; ~>= shift
arithmetic right; ->= bitwise rotate right; &= bitwise AND; and many
more.  The very "worst" of which is "<=" the boolean less than
assignment operator (setting a variable to True or False)!  That's a
trap waiting for you to fall in because "=>" is now the equal-or-greater
operator.

It's maddening to keep track of all of these assignments (26, if I count
correctly), and the "<=" ... while perfectly congruent -- a terminal
equals is always an assignment -- is so opposite the "natural"
comparison operator that it's always awkward (and difficult to remember).

I use at least nine fingers when I type (the left thumb is
underutilized), and I would prefer a "natural" syntax to a "shortcut"
syntax -- stopping short of Java and/or COBOL.  Programs are meant to be
READ by humans, and only EXECUTED by computers.  Make them easy to read.

Of late I've been working with Literate Programming, and find the
freedom from interpreter- or compiler-enforced code ordering remarkably
refreshing.  I have a small shrine to D.E.Knuth sitting on my bookshelf.

My vote: leave NetRexx syntax alone.  Implement these operators in <free
plug>Rey</free plug> as you see fit.

The other Tom.


_______________________________________________
Ibm-netrexx mailing list
[hidden email]