Discussion:
curious: Popularity & use of C on z/OS.
(too old to reply)
John McKown
2018-01-12 13:55:15 UTC
Permalink
This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
e***@JUNO.COM
2018-01-12 14:22:57 UTC
Permalink
From my perspective, I can't say that C is picking up on the mainframe.
From My personal observation, I don't see C programmers doing maintenance.
Every installation that had JAVA and/or C, the "programmer" always wanted to re-write the program, they were unable to read existing source code and make the required changes. Too Many times I have seen C programmers ask "What Does this program do ?
.
my observation only, No bias intended.




---------- Original Message ----------
From: John McKown <***@GMAIL.COM>
To: IBM-***@LISTSERV.UA.EDU
Subject: curious: Popularity & use of C on z/OS.
Date: Fri, 12 Jan 2018 07:56:08 -0600

This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bill Wilkie
2018-01-12 15:27:15 UTC
Permalink
I remember reading a story about a company looking to hire a C/C++ programmer and found someone with years of experience. And when they showed him the program, they hired him to change, he looked at it and said "What's this?"


Bill





________________________________
From: IBM Mainframe Discussion List <IBM-***@LISTSERV.UA.EDU> on behalf of ***@juno.com <***@JUNO.COM>
Sent: Friday, January 12, 2018 2:22 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.

From my perspective, I can't say that C is picking up on the mainframe.
From My personal observation, I don't see C programmers doing maintenance.
Every installation that had JAVA and/or C, the "programmer" always wanted to re-write the program, they were unable to read existing source code and make the required changes. Too Many times I have seen C programmers ask "What Does this program do ?
.
my observation only, No bias intended.




---------- Original Message ----------
From: John McKown <***@GMAIL.COM>
To: IBM-***@LISTSERV.UA.EDU
Subject: curious: Popularity & use of C on z/OS.
Date: Fri, 12 Jan 2018 07:56:08 -0600

This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?

--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Gord Tomlin
2018-01-12 15:42:08 UTC
Permalink
Post by Bill Wilkie
I remember reading a story about a company looking to hire a C/C++ programmer and found someone with years of experience. And when they showed him the program, they hired him to change, he looked at it and said "What's this?"
Was "What's this?" a comment on the quality of the code he was asked to
change, or an observation on the "weird" (to him) sources of
information, or something else?

--

Regards, Gord Tomlin
Action Software International
(a division of Mazda Computer Corporation)
Tel: (905) 470-7113, Fax: (905) 470-6507
Support: https://actionsoftware.com/support/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Joel C. Ewing
2018-01-12 14:50:27 UTC
Permalink
Post by John McKown
This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.
First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?
Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
For a new z/OS installation, getting  the IBM C compiler might not have
been a big deal.  For a large non-C, existing z/OS installation, IBM
compiler pricing issues in the past were always a powerful dis-incentive
to add anything that required the C compiler, 

When pricing was based on total system capacity, existing large
installations couldn't cost-justify adding the IBM C compiler for
additional $1000's per month for experimentation and would have highly
displeased if any product suddenly required it.   Being able to license
the compiler for use only in an MSU-limited LPAR provided some relief,
but still required the installation to be willing to eat the overhead of
setting up and managing another LPAR just to play with C.
    Joel C. Ewing
--
Joel C. Ewing, Bentonville, AR ***@acm.org

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-13 07:14:04 UTC
Permalink
Post by Joel C. Ewing
For a new z/OS installation, getting  the IBM C compiler might not have
been a big deal.  For a large non-C, existing z/OS installation, IBM
compiler pricing issues in the past were always a powerful dis-incentive
to add anything that required the C compiler,
When pricing was based on total system capacity, existing large
installations couldn't cost-justify adding the IBM C compiler for
additional $1000's per month for experimentation and would have highly
displeased if any product suddenly required it.   Being able to license
the compiler for use only in an MSU-limited LPAR provided some relief,
but still required the installation to be willing to eat the overhead of
setting up and managing another LPAR just to play with C.
There's a new kid on the block. IBM have ported clang to z/OS and it's
brand spanking up to date supporting features the IBM compiler doesn't.

You can get it for free if you download the Node.js beta. I've been
using it and it's sweet. A major issue is it's 64-bit only which may be
a blocker if you want to call legacy code. It also only runs in z/OS
UNIX so you can't compile using JCL.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Barkow, Eileen
2018-01-12 16:16:14 UTC
Permalink
C is a REALLY-REALLY hard language to learn (at least I am finding it to be so).
Actually, I am only trying to use C without really learning it which makes it even more difficult.

Java was created in order to be a simplification of C -
But of course the problem with Java on z/os is that it runs under Unix which scares off a lot of Cobol and other application programmers as well
as some Z/OS and RACF system programmers who do not want to be bothered setting up Unix for use by application programmers.
And Java incurs a lot more overhead, especially if you don’t have a ZAP processor (or is it ZIP?).

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Friday, January 12, 2018 8:56 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: curious: Popularity & use of C on z/OS.

This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?

--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


________________________________

This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2018-01-12 16:39:22 UTC
Permalink
Whoa now... Java is a lot of things, but it is definitely not a
simplification of C. You might call it a simplified ("different"
might be better) C++, but that's a whole 'nother thing.

C has very concise syntax.... you'd best invest the time in learning
it step-by-step, because little of it is intuitively obvious. But
it's not that hard, and it really won't take long if you know
assembler and/or some other language.

sas
Post by Barkow, Eileen
C is a REALLY-REALLY hard language to learn (at least I am finding it to be so).
Actually, I am only trying to use C without really learning it which makes it even more difficult.
Java was created in order to be a simplification of C -
But of course the problem with Java on z/os is that it runs under Unix which scares off a lot of Cobol and other application programmers as well
as some Z/OS and RACF system programmers who do not want to be bothered setting up Unix for use by application programmers.
And Java incurs a lot more overhead, especially if you don’t have a ZAP processor (or is it ZIP?).
-----Original Message-----
Sent: Friday, January 12, 2018 8:56 AM
Subject: curious: Popularity & use of C on z/OS.
This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.
First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?
Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
--
I have a theory that it's impossible to prove anything, but I can't prove
it.
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
________________________________
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Barkow, Eileen
2018-01-12 16:49:08 UTC
Permalink
I am quoting from a book or manual or self study course I read - Java was developed to be a simplification of C.
I will try to find this quote if I can.

As for learning C, I am still trying to study for the idiotic Java certification exam, where you have to pay $400 to predict what the compiler will do with
some convoluted, contrived code and where some of the supplied answers are clearly wrong and do not agree with what the compiler says.
I plan to 'retire' in the near future and maybe I can get some part time remote java coding work .
If not, then I just like Java better than C.
I did take a few self study C/C++ courses but forgot a lot of it since I did not really program much in C.


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Steve Smith
Sent: Friday, January 12, 2018 11:41 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.

Whoa now... Java is a lot of things, but it is definitely not a
simplification of C. You might call it a simplified ("different"
might be better) C++, but that's a whole 'nother thing.

C has very concise syntax.... you'd best invest the time in learning
it step-by-step, because little of it is intuitively obvious. But
it's not that hard, and it really won't take long if you know
assembler and/or some other language.

sas
Post by Barkow, Eileen
C is a REALLY-REALLY hard language to learn (at least I am finding it to be so).
Actually, I am only trying to use C without really learning it which makes it even more difficult.
Java was created in order to be a simplification of C -
But of course the problem with Java on z/os is that it runs under Unix which scares off a lot of Cobol and other application programmers as well
as some Z/OS and RACF system programmers who do not want to be bothered setting up Unix for use by application programmers.
And Java incurs a lot more overhead, especially if you don’t have a ZAP processor (or is it ZIP?).
-----Original Message-----
Sent: Friday, January 12, 2018 8:56 AM
Subject: curious: Popularity & use of C on z/OS.
This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.
First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?
Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
--
I have a theory that it's impossible to prove anything, but I can't prove
it.
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
________________________________
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
sas

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Pew, Curtis G
2018-01-12 17:09:32 UTC
Permalink
Post by Barkow, Eileen
I am quoting from a book or manual or self study course I read - Java was developed to be a simplification of C.
I will try to find this quote if I can.
That was either a typo for C++ or the author didn’t know what he was talking about.

From what I understand, Gosling’s motivation in developing Java was to make it safer than C++, not necessarily simpler. Bjarne Stroustrup himself said, “C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.” (http://www.stroustrup.com/bs_faq.html) Java’s original use case was “downloadable applications for set-top boxes” and a big concern was preventing such applications from crashing or compromising the system.
--
Pew, Curtis G
***@austin.utexas.edu
ITS Systems/Core/Administrative Services


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Barkow, Eileen
2018-01-12 17:07:41 UTC
Permalink
https://www.javatpoint.com/features-of-java



here is a quote from the java tutorial in the above url comparing java to C.

I originally saw a quote in a Lynda.com tutorial (which I no longer have access to) that also stated Java to be a simplification of C.


According to Sun, Java language is simple because:

syntax is based on C++ (so easier for programmers to learn it after C++).

removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc.

No need to remove unreferenced objects because there is Automatic Garbage Collection in java.

________________________________







-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Steve Smith
Sent: Friday, January 12, 2018 11:41 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.



Whoa now... Java is a lot of things, but it is definitely not a

simplification of C. You might call it a simplified ("different"

might be better) C++, but that's a whole 'nother thing.



C has very concise syntax.... you'd best invest the time in learning

it step-by-step, because little of it is intuitively obvious. But

it's not that hard, and it really won't take long if you know

assembler and/or some other language.



sas
Post by Barkow, Eileen
C is a REALLY-REALLY hard language to learn (at least I am finding it to be so).
Actually, I am only trying to use C without really learning it which makes it even more difficult.
Java was created in order to be a simplification of C -
But of course the problem with Java on z/os is that it runs under Unix which scares off a lot of Cobol and other application programmers as well
as some Z/OS and RACF system programmers who do not want to be bothered setting up Unix for use by application programmers.
And Java incurs a lot more overhead, especially if you don’t have a ZAP processor (or is it ZIP?).
-----Original Message-----
Sent: Friday, January 12, 2018 8:56 AM
Subject: curious: Popularity & use of C on z/OS.
This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.
First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?
Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?
--
I have a theory that it's impossible to prove anything, but I can't prove
it.
Maranatha! <><
John McKown
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
________________________________
This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--

sas



----------------------------------------------------------------------

For IBM-MAIN subscribe / signoff / archive access instructions,

send email to ***@listserv.ua.edu<mailto:***@listserv.ua.edu> with the message: INFO IBM-MAIN



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Peter Hunkeler
2018-01-13 07:19:21 UTC
Permalink
Post by Barkow, Eileen
https://www.javatpoint.com/features-of-java
Everything written on any web page is true, or what?

C is procedural programming language and as such it can be compared to COBOL, PL/1, Pascal, etc. But comparing a procedural language to an object oriented language just makes no sense to me.



--
Peter Hunkeler



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-12 17:27:24 UTC
Permalink
Let me weigh in on these topics. I am a very experienced HLASM product developer who switched his primary language to C++ about ten years ago.

First, how many end-user customers are undertaking the development of totally new applications? If you are fixing, enhancing or extending an application written in COBOL (or PL/I or even assembler) decades ago then committing to any new language makes little sense. I don't think it is a strike against C that few are doing so.

Second, I certainly didn't think C was very hard to learn. There was exactly one concept that I had trouble wrapping my arms around: that an array was an address, and that foo[0] was not the same thing as foo. Once I got really comfortable with that, I was good. I knew Rexx, some BASIC, a little FORTRAN, a smattering of PL/I, and once knew an old Intel language called PL/M. With that background, most of C was pretty easy.

Third, I would not recommend learning C. (What!?) If you are going to bother, learn C++. C is just kind of assembly language with a different format and a huge and helpful library. C has little advantage over the structured HLASM macros. C++, used well, is truly a game-changer. I have a co-worker who says "anything you can do in C++ I can do in C" and he is of course right. (Equally, anything I can do in C++ could be done by coding absolute machine instructions in hex.) But C++ provides an organization, a way of thinking about problems, that is truly a game changer. (And remember, I am not some PC kiddie or airline magazine manager. I wrote a successful mainframe commercial product in assembler.)

Fourth, I would recommend learning C++ the way I did, although it was accidental and I suspect few will heed my advice. During a period of non-employment I decided to stretch my brain by learning C#. C++ has a major flaw in that it is 99% a superset of C. You can be writing 1989 C and tell your manager you are writing C++, and there is no real way to call you out on that. C# is essentially C++ without the C. You are forced to write true object-oriented code. Then when mainframe product development again presented itself, C# is of course not really available on Z and so I transferred my new C# good habits to C++. I am a better C++ programmer because of C#.

Fifth, a detail. I don't know why IBM has not provided library functions like ENQ, but no matter, it is trivial to write them oneself. Some of them, such as WTO/WTOR, IBM has provided. (And FWIW, my guess is that the reason they did not is that their motivation for providing C on Z was not to enable new development, but to allow vendors like PeopleSoft to port their products. They provided the library functions that were required for that goal, and ENQ was not one of them.)

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Friday, January 12, 2018 5:56 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: curious: Popularity & use of C on z/OS.

This is being prompted by the recent thread about getting the name of the running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs, UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language, I find it interesting that IBM has not tried to make z/OS C have some of the same emphasis. Or maybe that is what Metal C is for. What I'm getting at is that there are no "system level" function interfaces, such as for ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Smith
2018-01-12 18:57:17 UTC
Permalink
Yeah, what Charles Mills said :-). He's a lot less lazy than me when
it comes to writing stuff out.

C++ *is* a superset of C, and it does provide several useful
enhancements (e.g. new/delete vs. malloc/free), but that's not what it
was invented for. It was invented to allow object-oriented
programming, and that is a whole new paradigm (game-changer as it
were). And I agree that it is a great thing (and fun) to learn and
do. But prepare for considerable mental effort to get there. btw, it
seems to me that C++ has been extended much further since I did much
work with it. Probably it's like C++++ now.

I don't know much about C# (call it "see pound" to impress people*),
but Java was invented (purportedly anyway) as a safer C++, and
likewise, basically forces object-oriented programming. I get the
feeling that C# was just microsoft's attempt to keep Java (Sun) from
taking over too much mind-share.

sas

*I didn't say it would be a good impression ;-)
Post by Charles Mills
Let me weigh in on these topics. I am a very experienced HLASM product developer who switched his primary language to C++ about ten years ago.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-12 19:23:10 UTC
Permalink
C++ is technically not quite a proper superset of C. For example, C allows implicit int declarations and C++ does not. But admittedly, a quibble. C++ is for all practical purposes a superset of C.

I have inside information on C# that it is probably okay if not legal to share.

C# started life inside MS as Visual Java. Sun's lawyers told MS no, you either Java our way or not at all. So MS re-wrote Visual Java into C#. C# is very Java-like and by extension C++-like, but without any non-OO possibilities at all. Programs don't start with a call to a static main(), they start with the instantiation of a program object. For a mainframe HLASM programmer, C# is a bigger leap than C -- but IMHO, a better leap, particularly if the ultimate goal is taking advantage of the tremendous benefits of OOP, on the mainframe.

Also, while I am cluttering up the thread anyway, let me address a question of @John's that I missed: what kind of programs did/do I write in C++? Answer, they all run as "conventional" z/OS programs, either as jobs or started tasks. Externally you would be hard-pressed to distinguish them from "classic" MVS programs written in HLASM.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Steve Smith
Sent: Friday, January 12, 2018 10:59 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.

Yeah, what Charles Mills said :-). He's a lot less lazy than me when it comes to writing stuff out.

C++ *is* a superset of C, and it does provide several useful
enhancements (e.g. new/delete vs. malloc/free), but that's not what it was invented for. It was invented to allow object-oriented programming, and that is a whole new paradigm (game-changer as it were). And I agree that it is a great thing (and fun) to learn and do. But prepare for considerable mental effort to get there. btw, it seems to me that C++ has been extended much further since I did much work with it. Probably it's like C++++ now.

I don't know much about C# (call it "see pound" to impress people*), but Java was invented (purportedly anyway) as a safer C++, and likewise, basically forces object-oriented programming. I get the feeling that C# was just microsoft's attempt to keep Java (Sun) from taking over too much mind-share.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
retired mainframer
2018-01-13 00:38:28 UTC
Permalink
Post by Barkow, Eileen
-----Original Message-----
Behalf Of Charles Mills
Sent: Friday, January 12, 2018 11:24 AM
Subject: Re: curious: Popularity & use of C on z/OS.
C++ is technically not quite a proper superset of C. For example, C allows implicit int
declarations and C++ does not. But admittedly, a quibble. C++ is for all practical purposes a
superset of C.
Your assertion is correct but your example is wrong. C no longer allows implicit int. One C feature that is not allowed in C++ is the implicit conversion from "pointer to void" to "pointer to object", forcing C++ programmers to use more casts than C programmers (on average).

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-13 01:06:42 UTC
Permalink
LOL. All I know is that sometimes due to a coding error I get the error message "error C4430: missing type specifier - int assumed. Note: C++ does not support default-int"

I jumped to the natural conclusion.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of retired mainframer
Sent: Friday, January 12, 2018 4:40 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Barkow, Eileen
-----Original Message-----
On Behalf Of Charles Mills
Sent: Friday, January 12, 2018 11:24 AM
Subject: Re: curious: Popularity & use of C on z/OS.
C++ is technically not quite a proper superset of C. For example, C
C++ allows implicit int
declarations and C++ does not. But admittedly, a quibble. C++ is for
all practical purposes a superset of C.
Your assertion is correct but your example is wrong. C no longer allows implicit int. One C feature that is not allowed in C++ is the implicit conversion from "pointer to void" to "pointer to object", forcing C++ programmers to use more casts than C programmers (on average).

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-13 06:56:07 UTC
Permalink
Post by Charles Mills
C# started life inside MS as Visual Java. Sun's lawyers told MS no, you either Java our way or not at all. So MS re-wrote Visual Java into C#. C# is very Java-like and by extension C++-like, but without any non-OO possibilities
C# started out Java-like but if you compare the two languages now C# has
evolved into a significantly better language. The only thing in Java's
favor is the huge eco-system. Oracles lack of investment in Java has
seen it stagnate to the point where it now feels old compared to the
likes of C# and the new kids on the block like Swift and Kotlin.
Microsoft were not afraid make breaking changes to C# to improve the
language. The insistence on keeping backwards compatibility has hurt
Java which is why we've seen the emergence of new languages for the JVM
like Kotlin, Scala and Groovy.

Sun were right to sue Microsoft wrt Java. Microsoft implemented their
own version of JNI which would have broken portability. It was part of
Microsoft's nefarious "Embrace, extend and extinguish" strategy back in 
the early 2000's. Thank goodness those days are over.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Gord Tomlin
2018-01-12 22:04:13 UTC
Permalink
Post by Steve Smith
I don't know much about C# (call it "see pound" to impress people*)
To really "B Sharp", call it "C Sharp" like the folks at Microsoft. ;)

--

Regards, Gord Tomlin
Action Software International
(a division of Mazda Computer Corporation)
Tel: (905) 470-7113, Fax: (905) 470-6507
Support: https://actionsoftware.com/support/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Beaver
2018-01-12 22:16:42 UTC
Permalink
The mainframe uses Metal C or Dingus C so you will have to do some research

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Gord Tomlin
Sent: Friday, January 12, 2018 4:05 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Steve Smith
I don't know much about C# (call it "see pound" to impress people*)
To really "B Sharp", call it "C Sharp" like the folks at Microsoft. ;)

--

Regards, Gord Tomlin
Action Software International
(a division of Mazda Computer Corporation)
Tel: (905) 470-7113, Fax: (905) 470-6507
Support: https://actionsoftware.com/support/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Jack J. Woehr
2018-01-13 05:04:53 UTC
Permalink
Post by Gord Tomlin
To really "B Sharp", call it "C Sharp" like the folks at Microsoft.
B Sharp is C :)
--
Jack J. Woehr # Science is more than a body of knowledge. It's a way of
www.well.com/~jax # thinking, a way of skeptically interrogating the universe
www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-12 19:41:38 UTC
Permalink
I disagree; C is not remotely like assembly language, and the pre-processor is pathetic compared to any other macro facility that I have seen. The confusion between pointers and arrays and the zero-delimited strings are booby traps for the unwary.

As to C++, it provides classes that are not subject to all of the pitfalls of the underlying C, so I would regard it as a safer choice.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Charles Mills <***@MCN.ORG>
Sent: Friday, January 12, 2018 12:28 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.

Let me weigh in on these topics. I am a very experienced HLASM product developer who switched his primary language to C++ about ten years ago.

First, how many end-user customers are undertaking the development of totally new applications? If you are fixing, enhancing or extending an application written in COBOL (or PL/I or even assembler) decades ago then committing to any new language makes little sense. I don't think it is a strike against C that few are doing so.

Second, I certainly didn't think C was very hard to learn. There was exactly one concept that I had trouble wrapping my arms around: that an array was an address, and that foo[0] was not the same thing as foo. Once I got really comfortable with that, I was good. I knew Rexx, some BASIC, a little FORTRAN, a smattering of PL/I, and once knew an old Intel language called PL/M. With that background, most of C was pretty easy.

Third, I would not recommend learning C. (What!?) If you are going to bother, learn C++. C is just kind of assembly language with a different format and a huge and helpful library. C has little advantage over the structured HLASM macros. C++, used well, is truly a game-changer. I have a co-worker who says "anything you can do in C++ I can do in C" and he is of course right. (Equally, anything I can do in C++ could be done by coding absolute machine instructions in hex.) But C++ provides an organization, a way of thinking about problems, that is truly a game changer. (And remember, I am not some PC kiddie or airline magazine manager. I wrote a successful mainframe commercial product in assembler.)

Fourth, I would recommend learning C++ the way I did, although it was accidental and I suspect few will heed my advice. During a period of non-employment I decided to stretch my brain by learning C#. C++ has a major flaw in that it is 99% a superset of C. You can be writing 1989 C and tell your manager you are writing C++, and there is no real way to call you out on that. C# is essentially C++ without the C. You are forced to write true object-oriented code. Then when mainframe product development again presented itself, C# is of course not really available on Z and so I transferred my new C# good habits to C++. I am a better C++ programmer because of C#.

Fifth, a detail. I don't know why IBM has not provided library functions like ENQ, but no matter, it is trivial to write them oneself. Some of them, such as WTO/WTOR, IBM has provided. (And FWIW, my guess is that the reason they did not is that their motivation for providing C on Z was not to enable new development, but to allow vendors like PeopleSoft to port their products. They provided the library functions that were required for that goal, and ENQ was not one of them.)

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of John McKown
Sent: Friday, January 12, 2018 5:56 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: curious: Popularity & use of C on z/OS.

This is being prompted by the recent thread about getting the name of the running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs, UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language, I find it interesting that IBM has not tried to make z/OS C have some of the same emphasis. Or maybe that is what Metal C is for. What I'm getting at is that there are no "system level" function interfaces, such as for ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bernd Oppolzer
2018-01-12 20:09:07 UTC
Permalink
Post by Seymour J Metz
I disagree; C is not remotely like assembly language, and the pre-processor is pathetic compared to any other macro facility that I have seen. The confusion between pointers and arrays and the zero-delimited strings are booby traps for the unwary.
As to C++, it provides classes that are not subject to all of the pitfalls of the underlying C, so I would regard it as a safer choice.
My experience is: C++ is VERY unsafe, because memory leaks are omnipresent
with C++. Even very experienced C++ developers (in their own thinking)
have a
very hard time explaining what's the reason of the memory leaks that I
discovered in their code.
To make it clear: I am a C programmer (and PL/1, ASSEMBLER, Pascal etc.)
and don't think of myself as a C++ expert; I only wrote some entry level
C++ programs.
But I was in charge of the maintenance of a very large software system
which had SOME
C++ modules in it; the greater part was C. And the memory leaks almost
always
occured in the C++ part.

I used some tools like the MEMCHECK heap manager (CEL4MCHK) and other
tools (even self-written)
to locate the memory leaks in the very large code base; the C++ folks
tried the same with
ValGrind, but most of the time I was faster.

IMO, C++ cannot be used to produce large reliable software packages; you
would need
ONLY SUPER SMART developers in your team, but as soon as there are some
mediocre
co-workers, you are lost.

With C, for example, you can always catch the storage allocations
functions (there are
only 4, after all: malloc, calloc, realloc, free) and replace them in
the whole software package
by something different which does all sort of diagnose, all that you
want. Try that in C++ ...

Furthermore, when fighting with those memory leaks, I discovered (and my
C++ affine
co-workers, too), that the different implementations of C++ on the
mainframe, on
Windows, on Solaris, did DIFFERENT things, which were all allowed by the
standard.
The C++ specialists couldn't agree about which platform does it right :-)

This is not an environment where I would like to work ... with C there
are no such problems.

My 2 cents ...

Kind regards

Bernd
Post by Seymour J Metz
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-12 23:40:50 UTC
Permalink
memory leaks are omnipresent with C++
I disagree. I will wager there are *zero* memory leaks in my code, other than a couple of disaster startup errors where I intentionally bail out prematurely.

I do my alpha development on MS Visual Studio. If I run a test and there are any memory leaks, it tells me. It shows me the length and 8 or so bytes in hex and character. If that is not enough to find the leak, it also assigns every malloc a number, and shows the offending malloc number. I can breakpoint on that malloc number and find the offending allocation. As part of our regression testing I run with HEAPCHK and that tells me if I have any leaks on z/OS.

More to the point is just discipline. Whenever I write a new (C++ for malloc() or 'GETMAIN') I stop and think "where will this get deleted" and code the delete right then and there. This is something that could be done trivially in code review.
With C, for example, you can always catch the storage allocations functions ...
and replace them in the whole software package by something different
which does all sort of diagnose, all that you want. Try that in C++ ...
Trivial. new is an operator. You can override it just like any other operator in C++.
https://www.geeksforgeeks.org/overloading-new-delete-operator-c/

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Bernd Oppolzer
Sent: Friday, January 12, 2018 12:10 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.
I disagree; C is not remotely like assembly language, and the pre-processor is pathetic compared to any other macro facility that I have seen. The confusion between pointers and arrays and the zero-delimited strings are booby traps for the unwary.
As to C++, it provides classes that are not subject to all of the pitfalls of the underlying C, so I would regard it as a safer choice.
My experience is: C++ is VERY unsafe, because memory leaks are omnipresent with C++. Even very experienced C++ developers (in their own thinking) have a very hard time explaining what's the reason of the memory leaks that I discovered in their code.
To make it clear: I am a C programmer (and PL/1, ASSEMBLER, Pascal etc.) and don't think of myself as a C++ expert; I only wrote some entry level
C++ programs.
But I was in charge of the maintenance of a very large software system which had SOME
C++ modules in it; the greater part was C. And the memory leaks almost
always
occured in the C++ part.

I used some tools like the MEMCHECK heap manager (CEL4MCHK) and other tools (even self-written) to locate the memory leaks in the very large code base; the C++ folks tried the same with ValGrind, but most of the time I was faster.

IMO, C++ cannot be used to produce large reliable software packages; you would need ONLY SUPER SMART developers in your team, but as soon as there are some mediocre co-workers, you are lost.

With C, for example, you can always catch the storage allocations functions (there are only 4, after all: malloc, calloc, realloc, free) and replace them in the whole software package by something different which does all sort of diagnose, all that you want. Try that in C++ ...

Furthermore, when fighting with those memory leaks, I discovered (and my
C++ affine
co-workers, too), that the different implementations of C++ on the mainframe, on Windows, on Solaris, did DIFFERENT things, which were all allowed by the standard.
The C++ specialists couldn't agree about which platform does it right :-)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-13 00:03:32 UTC
Permalink
My post below brings up one of the HUGE advantages of C++ and C: there are a ton of resources available on the Web. If I Google <C++ tips> I get 6,400,000 hits. If I Google <HLASM tips> I get 5,380 hits. Google hits are not the whole story, but you get my point. With HLASM if you hit a wall you have this list and the assembler list and not much more. With C++ there are dozens or hundreds or perhaps thousands of helpful Web sites, including the incredibly useful stackoverflow.com.

Is everything you read on the Web true? No, of course not. But just like on this list, if someone posts advice that is not perfect, three others are quick to jump in with corrections.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Charles Mills
Sent: Friday, January 12, 2018 3:42 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.

<snip>

Trivial. new is an operator. You can override it just like any other operator in C++.
https://www.geeksforgeeks.org/overloading-new-delete-operator-c/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-13 06:27:20 UTC
Permalink
Post by Bernd Oppolzer
Post by Seymour J Metz
I disagree; C is not remotely like assembly language, and the
pre-processor is pathetic compared to any other macro facility that I
have seen. The confusion between pointers and arrays and the
zero-delimited strings are booby traps for the unwary.
As to C++, it provides classes that are not subject to all of the
pitfalls of the underlying C, so I would regard it as a safer choice.
My experience is: C++ is VERY unsafe, because memory leaks are
omnipresent
with C++.
I would respectfully disagree with that statement. C++ gained a
reputation for leaking resources in the early 90s when exceptions were
introduced. That was before the STL and everybody was allocating string
buffers on the heap. RAII solved that problem decades ago. Because C
does not support RAII semantics having to explicitly free resources
makes it much more prone to resources leaks.

If your C++ programs have resource leaks then I would suggest they were
not designed and implemented by very good C++ programmers.

If I were to compose a list of criticisms of C++ resource leaks wouldn't
be on it.
Post by Bernd Oppolzer
Even very experienced C++ developers (in their own thinking) have a
very hard time explaining what's the reason of the memory leaks that I
discovered in their code.
To make it clear: I am a C programmer (and PL/1, ASSEMBLER, Pascal etc.)
and don't think of myself as a C++ expert; I only wrote some entry
level C++ programs.
But I was in charge of the maintenance of a very large software system
which had SOME
C++ modules in it; the greater part was C. And the memory leaks almost
always
occured in the C++ part.
I used some tools like the MEMCHECK heap manager (CEL4MCHK) and other
tools (even self-written)
to locate the memory leaks in the very large code base; the C++ folks
tried the same with
ValGrind, but most of the time I was faster.
IMO, C++ cannot be used to produce large reliable software packages;
you would need
ONLY SUPER SMART developers in your team, but as soon as there are
some mediocre
co-workers, you are lost.
LOL. You mean like web browsers, data bases, device drivers, JavaScript
engines, Java JVM's, back-end systems of Facebook, Google etc, etc.
Here's a curated list http://www.stroustrup.com/applications.html.

I would agree that C++ is a complex language and much harder to learn
than something like Java. But you certainly don't need genius level
engineers to support it.
Post by Bernd Oppolzer
With C, for example, you can always catch the storage allocations
functions (there are
only 4, after all: malloc, calloc, realloc, free) and replace them in
the whole software package
by something different which does all sort of diagnose, all that you
want. Try that in C++ ...
I've lost count of how many times I've seen C code with unchecked
mallocs.  Also the lack of exceptions in C makes error handling ugly and
error prone.

I consider the use of malloc/free or new/delete to be anti-patterns. Any
heap allocation should be wrapped in a smart pointer using
factory functions like std::make_unique or std::make_shared. z/OS C++
does not support those C++11 features yet but you can implement
something similar yourself or go and get boost. For char buffers use
std::vector<char> or std::string. Of course, you should always strive
for stack based instantiations.

If I see the new operator used in C++ code without something like
std::shared_ptr<Object>(new Object) it's a bad code smell. In fact I'm
leery when I see any
raw pointers in C++ code full stop. The only pointers I use are smart ones.
Post by Bernd Oppolzer
Furthermore, when fighting with those memory leaks, I discovered (and
my C++ affine
co-workers, too), that the different implementations of C++ on the
mainframe, on
Windows, on Solaris, did DIFFERENT things, which were all allowed by
the standard.
The C++ specialists couldn't agree about which platform does it right :-)
This is not an environment where I would like to work ... with C there
are no such problems.
And C has a completely different set of problems which is why I prefer
to use C++. And my code doesn't have any resource leaks because I stick
to tried and tested design patterns.
Post by Bernd Oppolzer
My 2 cents ...
Kind regards
Bernd
Post by Seymour J Metz
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Bernd Oppolzer
2018-01-13 08:52:23 UTC
Permalink
Post by David Crayford
Post by Bernd Oppolzer
Post by Seymour J Metz
I disagree; C is not remotely like assembly language, and the
pre-processor is pathetic compared to any other macro facility that
I have seen. The confusion between pointers and arrays and the
zero-delimited strings are booby traps for the unwary.
As to C++, it provides classes that are not subject to all of the
pitfalls of the underlying C, so I would regard it as a safer choice.
My experience is: C++ is VERY unsafe, because memory leaks are omnipresent
with C++.
I would respectfully disagree with that statement. C++ gained a
reputation for leaking resources in the early 90s when exceptions were
introduced. That was before the STL and everybody was allocating
string buffers on the heap. RAII solved that problem decades ago.
Because C does not support RAII semantics having to explicitly free
resources makes it much more prone to resources leaks.
Post by Bernd Oppolzer
With C, for example, you can always catch the storage allocations
functions (there are
only 4, after all: malloc, calloc, realloc, free) and replace them in
the whole software package
by something different which does all sort of diagnose, all that you
want. Try that in C++ ...
I've lost count of how many times I've seen C code with unchecked
mallocs.  Also the lack of exceptions in C makes error handling ugly
and error prone.
I consider the use of malloc/free or new/delete to be anti-patterns.
Any heap allocation should be wrapped in a smart pointer using
factory functions like std::make_unique or std::make_shared. z/OS C++
does not support those C++11 features yet but you can implement
something similar yourself or go and get boost. For char buffers use
std::vector<char> or std::string. Of course, you should always strive
for stack based instantiations.
If I see the new operator used in C++ code without something like
std::shared_ptr<Object>(new Object) it's a bad code smell. In fact I'm
leery when I see any
raw pointers in C++ code full stop. The only pointers I use are smart ones.
The problems we had in C++ had not to do with the explicit use of
new or malloc and forgotten frees etc.; they were much more subtle
and hard to find. There were errors in some class definitions, leading to
memory leaks, because the destructors of the class didn't work properly.
As I told you, even the very experienced C++ guys at the site claimed for
a long time that all was correct and there are no memory leaks in their code
until I proved it using - for example - CEL4MCHK. And then, days later, they
told me: oh, well, now we found it. And that was not one time, but many
times. You could say on every release of the software package. We did not
have such issues with the C part of the software, because there every
malloc / free is explicit and VISIBLE ...

We never needed tools to make our C software memory safe ... discipline
on the coders' part (never leave a function before freeing all the memory
you malloced) was sufficient for more than 20 years.

Kind regards

Bernd

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-13 14:52:16 UTC
Permalink
Post by Bernd Oppolzer
Post by David Crayford
If I see the new operator used in C++ code without something like
std::shared_ptr<Object>(new Object) it's a bad code smell. In fact
I'm leery when I see any
raw pointers in C++ code full stop. The only pointers I use are smart ones.
The problems we had in C++ had not to do with the explicit use of
new or malloc and forgotten frees etc.; they were much more subtle
and hard to find. There were errors in some class definitions, leading to
memory leaks, because the destructors of the class didn't work properly.
I'm interested to know what the subtle bugs were. I haven't experienced
any compiler bugs in destructors in the 15 years I've been coding C++ on
z/OS.
Post by Bernd Oppolzer
As I told you, even the very experienced C++ guys at the site claimed for
a long time that all was correct and there are no memory leaks in their code
until I proved it using - for example - CEL4MCHK. And then, days later, they
told me: oh, well, now we found it. And that was not one time, but many
times. You could say on every release of the software package. We did not
have such issues with the C part of the software, because there every
malloc / free is explicit and VISIBLE ...
I prefer implicit destruction of resources. It takes careful programming
in C to handle errors and free resources that usually requires lots of
code. I've always found the best way
to do that in C is a goto that branches to a cleanup block but oddly
that seems to be banned by most company coding standards. I've been
coding Java for the last couple of years and even with GC it's easy to
leak resources especially if you store objects in collections.

C++ destructors are executed when an object goes out of scope, which is
basically when it hits a closing brace. Taking John's example of a C ENQ
function we could easily implement that in C++ so the destructor issues
the DEQ when it goes out of scope. It will always happen even if an
exception is thrown.

{
    zos::scoped_enq_lock lock(major, minor);
    -- lots of code ...
   ...
} // destructor DEQ



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Jack J. Woehr
2018-01-13 16:47:46 UTC
Permalink
Post by David Crayford
Post by Bernd Oppolzer
My experience is: C++ is VERY unsafe, because memory leaks are omnipresent
with C++.
I would respectfully disagree with that statement
Me, too. My experience is: Weak programmers can make BASIC and LOGO leak
memory :)
--
Jack J. Woehr # Science is more than a body of knowledge. It's a way of
www.well.com/~jax # thinking, a way of skeptically interrogating the universe
www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-12 19:47:37 UTC
Permalink
No answer to your questions, just another question. How many z/OS or z/VM sites are using GCC?


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of John McKown <***@gmail.com>
Sent: Friday, January 12, 2018 8:56 AM
To: IBM-***@listserv.ua.edu
Subject: curious: Popularity & use of C on z/OS.

This is being prompted by the recent thread about getting the name of the
running job in C. These are just some random questions.

First, is C becoming more popular on z/OS? What for? I.e. batch programs,
UNIX commands, CICS transactions, Db2 applications, ... ?

Given that C, in other *IX systems, is a "system implementation" language,
I find it interesting that IBM has not tried to make z/OS C have some of
the same emphasis. Or maybe that is what Metal C is for. What I'm getting
at is that there are no "system level" function interfaces, such as for
ENQ/DEQ or "Name/Token" pairs. Would such interfaces be of any general use?

--
I have a theory that it's impossible to prove anything, but I can't prove
it.

Maranatha! <><
John McKown

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-13 17:59:44 UTC
Permalink
... The insistence on keeping backwards compatibility has hurt
Java ...
Sun were right to sue Microsoft wrt Java. Microsoft implemented their
own version of JNI which would have broken portability. ...
You seem to be contradicting yourself.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-13 18:05:50 UTC
Permalink
Post by David Crayford
There's a new kid on the block. IBM have ported clang to z/OS and it's
brand spanking up to date supporting features the IBM compiler doesn't.
You can get it for free if you download the Node.js beta. I've been
using it and it's sweet. A major issue is it's 64-bit only which may be
a blocker if you want to call legacy code.
That's merely forward-looking, in contrast to a dismaying residue of
24-bit dependency in z/OS.
Post by David Crayford
It also only runs in z/OS UNIX so you can't compile using JCL.
But you can run z/OS UNIX with JCL: BPXBATCH, BPXWUNIX,
Rexx SYSCALL facilities, ...

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-14 06:37:04 UTC
Permalink
Post by Paul Gilmartin
Post by David Crayford
There's a new kid on the block. IBM have ported clang to z/OS and it's
brand spanking up to date supporting features the IBM compiler doesn't.
You can get it for free if you download the Node.js beta. I've been
using it and it's sweet. A major issue is it's 64-bit only which may be
a blocker if you want to call legacy code.
That's merely forward-looking, in contrast to a dismaying residue of
24-bit dependency in z/OS.
Lot's of z/OS services don't have 64-bit interfaces.
Post by Paul Gilmartin
Post by David Crayford
It also only runs in z/OS UNIX so you can't compile using JCL.
But you can run z/OS UNIX with JCL: BPXBATCH, BPXWUNIX,
Rexx SYSCALL facilities, ...
True but your source code must reside in the z/OS UNIX file system. Not
a problem for me but maybe for some sites.
Post by Paul Gilmartin
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-13 18:17:29 UTC
Permalink
Post by David Crayford
...
I prefer implicit destruction of resources. It takes careful programming
in C to handle errors and free resources that usually requires lots of
code. I've always found the best way
to do that in C is a goto that branches to a cleanup block but oddly
that seems to be banned by most company coding standards. ...
"break" almost suffices. Alas, C, unlike Rexx, provides no way to exit a
specific block.

An alternative is a wrapper procedure:
acqire resources
call main body code
cleanup

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-14 06:28:17 UTC
Permalink
Post by Paul Gilmartin
Post by David Crayford
...
I prefer implicit destruction of resources. It takes careful programming
in C to handle errors and free resources that usually requires lots of
code. I've always found the best way
to do that in C is a goto that branches to a cleanup block but oddly
that seems to be banned by most company coding standards. ...
"break" almost suffices. Alas, C, unlike Rexx, provides no way to exit a
specific block.
acqire resources
call main body code
cleanup
Not as clean as a goto, especially in deeply nested code. Using goto for
control structures is poor practice but for error handling in languages
that don't support exceptions
it remains the best solution. Exceptions, break, continue are just
syntactic suger for goto.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-14 18:27:45 UTC
Permalink
Maybe goto is just a branch in some languages, but certainly not in any language with an Algol 60 flavor, e.g., PL/I.

As for using goto for control structures, there are valid use cases. If you use a screwdriver to pound in a nail, don't blame the screwdriver for the poor results.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of David Crayford <***@GMAIL.COM>
Sent: Sunday, January 14, 2018 1:29 AM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Paul Gilmartin
Post by David Crayford
...
I prefer implicit destruction of resources. It takes careful programming
in C to handle errors and free resources that usually requires lots of
code. I've always found the best way
to do that in C is a goto that branches to a cleanup block but oddly
that seems to be banned by most company coding standards. ...
"break" almost suffices. Alas, C, unlike Rexx, provides no way to exit a
specific block.
acqire resources
call main body code
cleanup
Not as clean as a goto, especially in deeply nested code. Using goto for
control structures is poor practice but for error handling in languages
that don't support exceptions
it remains the best solution. Exceptions, break, continue are just
syntactic suger for goto.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-14 18:34:25 UTC
Permalink
REXX certainly has the ability to terminate a specific loop from within a nested looped, but there are major lacuna. REXX doesn't have a goto, and trying to use signal as an alternative can be - interesting. OTOH, PL/I does a good job of cleaning up on block exit. Likewise Ada, although it doesn't seem to be very popular these days.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Paul Gilmartin <0000000433f07816-dmarc-***@listserv.ua.edu>
Sent: Saturday, January 13, 2018 1:18 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by David Crayford
...
I prefer implicit destruction of resources. It takes careful programming
in C to handle errors and free resources that usually requires lots of
code. I've always found the best way
to do that in C is a goto that branches to a cleanup block but oddly
that seems to be banned by most company coding standards. ...
"break" almost suffices. Alas, C, unlike Rexx, provides no way to exit a
specific block.

An alternative is a wrapper procedure:
acqire resources
call main body code
cleanup

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Jack J. Woehr
2018-01-14 20:39:09 UTC
Permalink
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
--
Jack J. Woehr # Science is more than a body of knowledge. It's a way of
www.well.com/~jax # thinking, a way of skeptically interrogating the universe
www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Mike Beer
2018-01-14 20:50:59 UTC
Permalink
SIGNAL can be used nicely to jump out of a (nested) loop to go to a defined end point.
If you need to stay in a loop, you might consider using ITERATE or LEAVE.

-----Ursprüngliche Nachricht-----
Von: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] Im Auftrag von Jack J. Woehr
Gesendet: 14 January, 2018 21:40
An: IBM-***@LISTSERV.UA.EDU
Betreff: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
--
Jack J. Woehr # Science is more than a body of knowledge. It's a way of
www.well.com/~jax # thinking, a way of skeptically interrogating the universe www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-16 18:50:38 UTC
Permalink
That's a common beginners' mistake. Try putting the label inside a do block and see what happens. A proper goto would pop what needs to be popped and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Jack J. Woehr <***@WELL.COM>
Sent: Sunday, January 14, 2018 3:40 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL

--
Jack J. Woehr # Science is more than a body of knowledge. It's a way of
http://secure-web.cisco.com/1jtOOBq4sFz3oGxbQdVMeH4FynpWpZSZ7UgIf-o7VDjlNc674trigtFa9PN4RHxqSUazUZ2ndWNWDFckafV-EJm3AEx3l2XUZHEan-otspWyMzNcRx0X81aPXt7b2okyLbdLxEyf5b6R-wdEebdTA6c1xgYjYl8isXU8oir_FX3P7iO-dBBFAhpCQDo8IdnT4tnSWJLSzO36ILBC-cpj-dyJBP4tXo8xyFTkvdxjq3IqBkSI2x1_CR8U7Lzd6HjZmfxqfaGMnPIM1g23H0JTuZL-BDj8nYtcV0EBnOyVwXlLsPbB-akdpSHRC-36rmfNe56g1xykG7r7tkpwdDkcuFm5Kd1RwqxGgIHsD5wZAQZRFtkef_a0LpQgXnywtkXSWpWO_56bYJ9rcPxiR7cT0d2Es_2YVVOLFQ9BBxerdRZjQ4hW5Ig4M5A9t_FWGMTIY/http%3A%2F%2Fwww.well.com%2F%7Ejax # thinking, a way of skeptically interrogating the universe
www.softwoehr.com # with a fine understanding of human fallibility. - Carl Sagan

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-13 18:38:52 UTC
Permalink
Post by Seymour J Metz
No answer to your questions, just another question. How many z/OS or z/VM sites are using GCC?
Too few. I lay part of the blame on EBCDIC.
Post by Seymour J Metz
I disagree; C is not remotely like assembly language, and the pre-processor is pathetic compared to any other macro facility that I have seen.
There might be some argument here that the pre-processor should have been
designed as a replacable module: substitute a better one, ad lib.

OTOH, I worked a while with Mainsail where the generative facility was
fully integrated with the compiler, as if EQU and SETA were the same
operation, and there was "if declared()", not "if defined()", and SETC
was simply a case of macro definition.
Post by Seymour J Metz
The confusion between pointers and arrays ...
Assembler programmers should be comfortable wth that (not that it makes
it right.) When I worked with some assembler veterans who had been dragged
willy-nilly into Pascal (late 1970s) the chief complaints included: "Why can't
I increment a pointer to get to the next array element?" (C allows that.) And:
Why can't I 'dispose' part rather than all of a block of storage obtained with
'new'?" (Not in C, either.)
Post by Seymour J Metz
and the zero-delimited strings are booby traps for the unwary.
Yup.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-14 18:16:52 UTC
Permalink
If gcc doesn't support EBCDIC, I'd blame gcc, not EBCDIC.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Paul Gilmartin <0000000433f07816-dmarc-***@listserv.ua.edu>
Sent: Saturday, January 13, 2018 1:40 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
No answer to your questions, just another question. How many z/OS or z/VM sites are using GCC?
Too few. I lay part of the blame on EBCDIC.
Post by Seymour J Metz
I disagree; C is not remotely like assembly language, and the pre-processor is pathetic compared to any other macro facility that I have seen.
There might be some argument here that the pre-processor should have been
designed as a replacable module: substitute a better one, ad lib.

OTOH, I worked a while with Mainsail where the generative facility was
fully integrated with the compiler, as if EQU and SETA were the same
operation, and there was "if declared()", not "if defined()", and SETC
was simply a case of macro definition.
Post by Seymour J Metz
The confusion between pointers and arrays ...
Assembler programmers should be comfortable wth that (not that it makes
it right.) When I worked with some assembler veterans who had been dragged
willy-nilly into Pascal (late 1970s) the chief complaints included: "Why can't
I increment a pointer to get to the next array element?" (C allows that.) And:
Why can't I 'dispose' part rather than all of a block of storage obtained with
'new'?" (Not in C, either.)
Post by Seymour J Metz
and the zero-delimited strings are booby traps for the unwary.
Yup.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-14 16:29:29 UTC
Permalink
Post by David Crayford
Lot's of z/OS services don't have 64-bit interfaces.
<whimper>
Post by David Crayford
True but your source code must reside in the z/OS UNIX file system. Not
a problem for me but maybe for some sites.
They need an attitude adjustment; same as for PDSE and still earlier for VSAM.

But it would be nice if the Classic data set ensemble could appear at a UNIX
mountpoint; sort of NFS //localhost.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Mike Schwab
2018-01-14 17:45:59 UTC
Permalink
Mount data.set.name as /zos/data/set/name
or data.set.name(member) as /zos/data/set/name/member ?

On Sun, Jan 14, 2018 at 10:30 AM, Paul Gilmartin
Post by Paul Gilmartin
Post by David Crayford
Lot's of z/OS services don't have 64-bit interfaces.
<whimper>
Post by David Crayford
True but your source code must reside in the z/OS UNIX file system. Not
a problem for me but maybe for some sites.
They need an attitude adjustment; same as for PDSE and still earlier for VSAM.
But it would be nice if the Classic data set ensemble could appear at a UNIX
mountpoint; sort of NFS //localhost.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-14 22:11:26 UTC
Permalink
Post by Seymour J Metz
REXX certainly has the ability to terminate a specific loop from within a nested looped, but there are major lacuna. REXX doesn't have a goto,
I've missed longjump, for reasons discussed in this thread, but never goto.
I've used signal only to trap errors, not as an instruction,
Post by Seymour J Metz
and trying to use signal as an alternative can be - interesting. OTOH, PL/I does a good job of cleaning up on block exit. Likewise Ada, although it doesn't seem to be very popular these days.
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-16 18:44:37 UTC
Permalink
The longjump construct is just a goto without the syntactic sugar. The C goto statement, OTOH, is missing the proper semantics.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Paul Gilmartin <0000000433f07816-dmarc-***@listserv.ua.edu>
Sent: Sunday, January 14, 2018 5:12 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
REXX certainly has the ability to terminate a specific loop from within a nested looped, but there are major lacuna. REXX doesn't have a goto,
I've missed longjump, for reasons discussed in this thread, but never goto.
I've used signal only to trap errors, not as an instruction,
Post by Seymour J Metz
and trying to use signal as an alternative can be - interesting. OTOH, PL/I does a good job of cleaning up on block exit. Likewise Ada, although it doesn't seem to be very popular these days.
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-14 22:12:59 UTC
Permalink
Post by Jack J. Woehr
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
No. Don't try it. (Or am I missing some sarcasm?)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-15 00:06:08 UTC
Permalink
What's the problem with SIGNAL?

(I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the seventies.)

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin
Sent: Sunday, January 14, 2018 2:14 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Jack J. Woehr
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
No. Don't try it. (Or am I missing some sarcasm?)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
David Crayford
2018-01-15 03:44:14 UTC
Permalink
Post by Charles Mills
What's the problem with SIGNAL?
(I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the seventies.)
Unfortunately, a lot of people were intoxicated by the Structured
Programming Kool-Aid. I've lost count of how many programs I've seen
over the years with horrible, deeply nested code just to avoid branching
to a function exit point. Take a sample of code from the golden era of
structured programming and there's a very good chance it will be
littered with the arrow anti-pattern.
Post by Charles Mills
Charles
-----Original Message-----
Sent: Sunday, January 14, 2018 2:14 PM
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Jack J. Woehr
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
No. Don't try it. (Or am I missing some sarcasm?)
-- gil
----------------------------------------------------------------------
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Clark Morris
2018-01-18 03:03:24 UTC
Permalink
[Default] On 14 Jan 2018 19:44:14 -0800, in bit.listserv.ibm-main
Post by David Crayford
Post by Charles Mills
What's the problem with SIGNAL?
(I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the seventies.)
Unfortunately, a lot of people were intoxicated by the Structured
Programming Kool-Aid. I've lost count of how many programs I've seen
over the years with horrible, deeply nested code just to avoid branching
to a function exit point. Take a sample of code from the golden era of
structured programming and there's a very good chance it will be
littered with the arrow anti-pattern.
COBOL compilers starting with OS/VS COBOL release 1.4, the 1985
standard COBOL have been optimized for structured constructs. Finally
with Enterprise COBOL release 5.2 EXIT PERFORM, EXIT PERFORM CYCLE,
EXIT PARAGRAPH and EXIT SECTION have eliminated the need for GO TO
statement if one is willing to PERFORM a clean-up paragraph that will
exit the program, sub-program or method if a program terminating error
is found. The reason for always using PERFORM paragraph and never
using the PERFORM para-x THRU para-y and avoiding GO TO is so that the
compiler can do code movement and generate simpler perform statements
that don't have to take into account the possibility of fall through
code. COBOL now has
PERFORM UNTIL condition-1
statement-1
statement-2
statements-etc
END-PERFORM
so DO loops can be coded without GO TO statements.

I have found the structured methodology useful in developing programs
and the PERFORM enhancement very useful in writing clearer programs.
With code movement it has meant that when a nested IF statement got to
convoluted I could split some of the inner nesting out into a separate
paragraph with no loss of efficiency because the code would be moved
back in line. I write this as someone who made extensive use of ALTER
switch-paragraph TO PROCEED TO desired-paragraph, GO TO
paragraph-before-switch instead of PERFORM to save memory in DOS-360
to fit into a 16K partition and wrote programs without ANY PERFORM
statements.

Clark Morris
Post by David Crayford
Post by Charles Mills
Charles
-----Original Message-----
Sent: Sunday, January 14, 2018 2:14 PM
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Jack J. Woehr
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
No. Don't try it. (Or am I missing some sarcasm?)
-- gil
----------------------------------------------------------------------
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-15 00:29:55 UTC
Permalink
Post by Charles Mills
What's the problem with SIGNAL?
(I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the seventies.)
SIGNAL obliterates the active block structure of the current procedure but
doesn't exit any procedure.

A naive colleague once used SIGNAL labelname intending to exit a called
procedure and return to a label before the main loop on an exceptional
condition. Worked fine on test data. In production, it failed as soon as a
large enough data set caused enough SIGNALs to overflow the call/return
stack on the next iteration. Not easy to fix.

Do not branch around the LM; FREEMAIN!

I wish that ITERATE controlvariable and LEAVE controlvariable were enhanced
to operate on any controlled DO with controlvariable in scope (EXPOSEd) even
if the DO were in an enclosing procedure, and exit cleanly any intervening
procedures -- a 1970's-structured longjump.

ITERATE mainloop would have nicely solved my colleague's problem.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Charles Mills
2018-01-15 01:21:41 UTC
Permalink
I did not realize that. (See, I've never used it.) The documentation (I am looking at the Cowlishaw book as I write this, not the IBM manuals) is less than clear on that important point. "All active pending DO loops, ... are terminated (i.e., they cannot be reactivated)" on a quick read would to me to imply the opposite.

I guess you could use SIGNAL as a DO exit only if you intended to terminate the program, not to recover and go on.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin
Sent: Sunday, January 14, 2018 4:31 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Charles Mills
What's the problem with SIGNAL?
(I've written a lot of Rexx, but never used SIGNAL labelname, only
SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the
seventies.)
SIGNAL obliterates the active block structure of the current procedure but doesn't exit any procedure.

A naive colleague once used SIGNAL labelname intending to exit a called procedure and return to a label before the main loop on an exceptional condition. Worked fine on test data. In production, it failed as soon as a large enough data set caused enough SIGNALs to overflow the call/return stack on the next iteration. Not easy to fix.

Do not branch around the LM; FREEMAIN!

I wish that ITERATE controlvariable and LEAVE controlvariable were enhanced to operate on any controlled DO with controlvariable in scope (EXPOSEd) even if the DO were in an enclosing procedure, and exit cleanly any intervening procedures -- a 1970's-structured longjump.

ITERATE mainloop would have nicely solved my colleague's problem.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-15 02:05:44 UTC
Permalink
Post by Charles Mills
I did not realize that. (See, I've never used it.) The documentation (I am looking at the Cowlishaw book as I write this, not the IBM manuals) is less than clear on that important point. "All active pending DO loops, ... are terminated (i.e., they cannot be reactivated)" on a quick read would to me to imply the opposite.
I guess you could use SIGNAL as a DO exit only if you intended to terminate the program, not to recover and go on.
I believe you can RETURN to the caller; I believe its DO loops are unaffected.
Post by Charles Mills
-----Original Message-----
From: Paul Gilmartin
Sent: Sunday, January 14, 2018 4:31 PM
SIGNAL obliterates the active block structure of the current procedure but doesn't exit any procedure.
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Dave Jones
2018-01-15 17:55:25 UTC
Permalink
gcc390: https://github.com/jphartmann

DJ

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-15 21:06:11 UTC
Permalink
Post by Dave Jones
gcc390: https://github.com/jphartmann
Is that merged back into mainstream gcc source in order to take
advantage of contiuing maintenance?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Dave Jones
2018-01-15 21:14:19 UTC
Permalink
Hi, Paul.
I would guess that it is not, but since the gcc it uses is just the "normal" available gcc on a Linux distro, any updates to that are automatically used by the gcc390 process steps.Very handy to have if what you want to do is take some C code and get it ported over the the CMS envrionment.
DJ

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-15 21:28:29 UTC
Permalink
Post by Dave Jones
Hi, Paul.
I would guess that it is not, but since the gcc it uses is just the "normal" available gcc on a Linux distro, any updates to that are automatically used by the gcc390 process steps.Very handy to have if what you want to do is take some C code and get it ported over the the CMS envrionment.
Sounds more like a cross-compiler; not useful unless you have Linux?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-15 22:05:34 UTC
Permalink
Post by Dave Jones
gcc390: https://github.com/jphartmann
I also see:

David Pitts' GCC Compiler Page
http://www.cozx.com/dpitts/gcc.html
Last modified 2008/03/11

http://www.cbttape.org/cbtdowns.htm
File # 852 GCCMVS - GCC C-Compiler and Library - 3.2.3 for MVS
File # 853 GCCMVS - GCC C-Compiler and Library - 3.4.6 for MVS

Is anyone using these? Any review comments? Are the sources merged with mainstream?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Mike Schwab
2018-01-16 01:16:55 UTC
Permalink
They were the impetous for the MVS380 project to get 31 bit address
spaces into MVS 3.8.

On Mon, Jan 15, 2018 at 4:06 PM, Paul Gilmartin
Post by Paul Gilmartin
Post by Dave Jones
gcc390: https://github.com/jphartmann
David Pitts' GCC Compiler Page
http://www.cozx.com/dpitts/gcc.html
Last modified 2008/03/11
http://www.cbttape.org/cbtdowns.htm
File # 852 GCCMVS - GCC C-Compiler and Library - 3.2.3 for MVS
File # 853 GCCMVS - GCC C-Compiler and Library - 3.4.6 for MVS
Is anyone using these? Any review comments? Are the sources merged with mainstream?
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Dave Jones
2018-01-16 16:18:23 UTC
Permalink
Hi, Paul.
Yes, using gcc390 requires a Linux system, either z/Linux running on the mainframe (in which case, the normal s390x gcc compiler is used), or Linux on Intel, using gcc in a cross compiler mode.

DJ

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-01-16 19:18:24 UTC
Permalink
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do block and see what happens. A proper goto would pop what needs to be popped and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.

There I also read:
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?

And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!

_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-16 20:48:54 UTC
Permalink
You're right - it's only when a string or a comment splits lines that continuation is implied, at least according to the last document I checked. I'd update it, but it really needs to have ANSI and OOREXX information folded in as well.

The goto is just one of the things that horrified me the first time I saw C.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Paul Gilmartin <0000000433f07816-dmarc-***@listserv.ua.edu>
Sent: Tuesday, January 16, 2018 2:19 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do block and see what happens. A proper goto would pop what needs to be popped and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.

There I also read:
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?

And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!

_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Gerard Schildberger
2018-01-16 22:11:50 UTC
Permalink
Post by Seymour J Metz
You're right - it's only when a string or a comment splits lines that continuation is implied, at least according to the last document I checked. I'd update it, but it really needs to have ANSI and OOREXX information folded in as well.
How about the implied continuations for the REXX statements:


if x>y then
x=z
else
x=y

if x<y
then
x=.

_____________________________________ Gerard Schildberger
Post by Seymour J Metz
The goto is just one of the things that horrified me the first time I saw C.
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Discussion List on behalf of Paul Gilmartin
Sent: Tuesday, January 16, 2018 2:19 PM
Subject: Re: curious: Popularity & use of C on z/OS.
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do block and see what happens. A proper goto would pop what needs to be popped and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
David Crayford
2018-01-17 12:09:44 UTC
Permalink
Post by Paul Gilmartin
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do block and see what happens. A proper goto would pop what needs to be popped and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
If you don't like those semantics don't use goto. My ROT is to only use
goto for branching to error handlers or cleanup routines.

If you look at the Linux kernel code including s390 you will see lots of
goto statements used just for that purpose. It's amusing to read threads
about what the maintainers think about this subject
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-in-Linux-Kernel-Code/.
Post by Paul Gilmartin
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Wayne Bickerdike
2018-01-18 00:24:30 UTC
Permalink
The old goto chestnut drops again.

*Considered harmful* is a part of a phrasal template
<https://en.wikipedia.org/wiki/Phrasal_template> used in the titles of at
least 65 critical essays in computer science
<https://en.wikipedia.org/wiki/Computer_science> and related disciplines.[1]
<https://en.wikipedia.org/wiki/Considered_harmful#cite_note-1> Its use in
this context originated in 1968 with Edsger Dijkstra
<https://en.wikipedia.org/wiki/Edsger_Dijkstra>'s letter "Go To Statement
Considered Harmful".'t the originator of "goto considered harmful".

I thought Michael Jackson defused it well it the 1970s with his structured
programming book and methods. GOTO was absolutely necessary in many cases.

I'll posit that most will agree and admit that some won't.
Post by David Crayford
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do
Post by Seymour J Metz
block and see what happens. A proper goto would pop what needs to be popped
and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
If you don't like those semantics don't use goto. My ROT is to only use
goto for branching to error handlers or cleanup routines.
If you look at the Linux kernel code including s390 you will see lots of
goto statements used just for that purpose. It's amusing to read threads
about what the maintainers think about this subject
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-
in-Linux-Kernel-Code/.
Post by Seymour J Metz
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Wayne V. Bickerdike

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-01-18 18:23:58 UTC
Permalink
The use of goto is a religious issue and will never be settled by mere facts. For those seriously interested, Knuth's "Structured Programming With GOTO" is a must read.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Wayne Bickerdike <***@GMAIL.COM>
Sent: Wednesday, January 17, 2018 7:25 PM
To: IBM-***@listserv.ua.edu
Subject: Re: curious: Popularity & use of C on z/OS.

The old goto chestnut drops again.

*Considered harmful* is a part of a phrasal template
<https://secure-web.cisco.com/14EjuPbEqBR2TOLZ2OQr9JQxQmAQdWgvR1bWOjO6iYGUjCzOci8zw5ZHVWKI6TCMh2O-a0037g6gvVoLs5rJ7ZSF1A3lr10opMp83yO7hH8M20yeMRerCCLZJudX7-r2b6fuuveUD8l5QzG3gXdxitSg8dEzrnd6AS1fxsLctbHYP5_VXDwS5a-YNILaXWeZKYT6kx6vy0gsWUeqdF-z-XoiPuQKCELjC8wilwhplzrSeTItolglcYgwDHE6n1UufdNEZ4F2Y4AaIBorKrbioGPO81IJgIM_kuiqCBsknB06mCfr_WftWARKRTe-1elpl_fpr_ujQVKwLEfS5fXtCGOiovTYr3RovyUjJjoFLOveoCnAceLYvb0vX2f45rNFMThhSbSzuyFtKpIfxXVBw69W841aHU89tgOCRE3-UZfgyNGt1xPp13O8Vfodgc61R/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FPhrasal_template> used in the titles of at
least 65 critical essays in computer science
<https://secure-web.cisco.com/1qy3QBktDYR951cD_ltco2Bt2RTxdDYwT6eEOLzC_ESyTVuf1_-Z2QKuIad7t6WP3H_IGbHTUFbwUNJFKz45fi0Hb68g2c4oRBGGmu2eITfa6FYTaDQ5y8qblXex-G6k9e1pZ1ApydHELC1PLxohsOLlyuNimns8eIXcJ0U8UL0jR9UtliNdB5EnJT0Ffv0BTqITAU_ecxLldPoEknOS4U7tkgPQa_AF0eD3exfkAemtnGFOnAOph2faDq3nknYGw6vJBuFxpNfVpehJPX7XLeiTMN_tdmWiFoPjH_vILbLLkYBGHTzj5KZM6SpJV82NDL9ttG_CCDhS8Z_pItx4nvFrjT-8lEqjUTfrxh3bgrErAkIxFAorOCKf_IqR15eyctvg2vdVU2bwp544SkRVx29DptOJWLz-pSRHgAEqYh0rA9PgrV-ifK3Fva6nuWxX7/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComputer_science> and related disciplines.[1]
<https://secure-web.cisco.com/1rOY6ytga6HS-D2EDrQFJyXhID_v_kMMf7g_jd6hMUte_akUZRqeBS6vaLPW72HYr4pyTpo2IrCulJkIRNGvdzHZIxWt4hYDltf7vEFpPDJfwJK964Z1h3-QaIt5APJBA4HhcKF-R0Dg3AqX6-O1O4RASnEdxYJq6t3GE-Ew5GvpXz---hed0mh0iMHf8NOFaFuYPXYmJWTNN_4udl5YzoKU6ccbvMWiwB3nasNIRYB3XGK1Jy_4VtoahKndOUfQho7bUgrRN8NdRHbhv4k8JFM8PJPzxiInn3N8soWcXr0G7Ym7ih-0ISj02xpaFU9zF876GN2Qag7XlUodeWOiDyPyx3SAKNqdjmCfk3sDTZ3V0tA4p4opCcKTiwSKjCXN3QRtWPjcSVKL1UAlVcm01lAkqRRcljI9BWd_b7xr66PiUDL0QNeeYGkx2EHLbb8CJ/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FConsidered_harmful#cite_note-1> Its use in
this context originated in 1968 with Edsger Dijkstra
<https://secure-web.cisco.com/196ZUsch82vGh_I5bP4bTlaCOGyHbJQ-yYZRHJe0CvrUkhu0REBi_O0uKg-263jd3RmOmzTHmysgJknV4B_-mSAsGATL4EyGCmBuTIpO5eIWv3OvWxhKaC-stBzvYwnUrrIgO9I_abAAKpAK0cxyTT9DyDJC9i-MhJkOxLxo2vC0skTBZGVNE8gIPLT3PFgdZtvbVfu_uZbrifGP1li7Jktc-I_ctB7Z1vmLGZv4q5DUwdxqpxW56wqOeT6uhc6KJq0m3tv4Fm0DHIJejEPIhPVyJjT9jikO336Ri5mVlioB3OvXPqBgyMBZxa3kxt0k42sALV_fI64Zpyvv0L2BV8ByTR3-zYl5koka00uR9tQIy0CPXumKOo-XAVH3o0lENOhZKQFdwC2LQFsMQOHTlevkowMAMExUXz4jSn5m9OUbpY4CMP0M6qx9s9s2NEgCq/https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEdsger_Dijkstra>'s letter "Go To Statement
Considered Harmful".'t the originator of "goto considered harmful".

I thought Michael Jackson defused it well it the 1970s with his structured
programming book and methods. GOTO was absolutely necessary in many cases.

I'll posit that most will agree and admit that some won't.
Post by David Crayford
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do
Post by Seymour J Metz
block and see what happens. A proper goto would pop what needs to be popped
and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
If you don't like those semantics don't use goto. My ROT is to only use
goto for branching to error handlers or cleanup routines.
If you look at the Linux kernel code including s390 you will see lots of
goto statements used just for that purpose. It's amusing to read threads
about what the maintainers think about this subject
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-
in-Linux-Kernel-Code/.
Post by Seymour J Metz
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Wayne V. Bickerdike

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Joel C. Ewing
2018-01-18 05:04:49 UTC
Permalink
One of the issues of ACM SIGPLAN Notices definitively resolved this
issue by suggesting that the any need for the harmful semantics of GOTO
statement could easily be eliminated by instead allowing a "COME FROM"
statement.  I can't remember which year, but it was an April issue.  :)
    JC Ewing
Post by Wayne Bickerdike
The old goto chestnut drops again.
*Considered harmful* is a part of a phrasal template
<https://en.wikipedia.org/wiki/Phrasal_template> used in the titles of at
least 65 critical essays in computer science
<https://en.wikipedia.org/wiki/Computer_science> and related disciplines.[1]
<https://en.wikipedia.org/wiki/Considered_harmful#cite_note-1> Its use in
this context originated in 1968 with Edsger Dijkstra
<https://en.wikipedia.org/wiki/Edsger_Dijkstra>'s letter "Go To Statement
Considered Harmful".'t the originator of "goto considered harmful".
I thought Michael Jackson defused it well it the 1970s with his structured
programming book and methods. GOTO was absolutely necessary in many cases.
I'll posit that most will agree and admit that some won't.
Post by David Crayford
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do
Post by Seymour J Metz
block and see what happens. A proper goto would pop what needs to be popped
and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
If you don't like those semantics don't use goto. My ROT is to only use
goto for branching to error handlers or cleanup routines.
If you look at the Linux kernel code including s390 you will see lots of
goto statements used just for that purpose. It's amusing to read threads
about what the maintainers think about this subject
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-
in-Linux-Kernel-Code/.
Post by Seymour J Metz
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
--
Joel C. Ewing, Bentonville, AR ***@acm.org

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Wayne Bickerdike
2018-01-18 07:36:02 UTC
Permalink
I was at IBM from 1978 and I certainly remember the spoof on the "COME
FROM" statement.

Some wag inside IBM wrote a fairly convincing treatise which was called
"Structured Programming IBM's answer to the GOTO statement".

At the time IBM were actively training us in Jackson Structured
programming. It was largely a local effort at Northern Road in Cosham. It
never made it to the guys at RESPOND.
Post by Joel C. Ewing
One of the issues of ACM SIGPLAN Notices definitively resolved this
issue by suggesting that the any need for the harmful semantics of GOTO
statement could easily be eliminated by instead allowing a "COME FROM"
statement. I can't remember which year, but it was an April issue. :)
JC Ewing
Post by Wayne Bickerdike
The old goto chestnut drops again.
*Considered harmful* is a part of a phrasal template
<https://en.wikipedia.org/wiki/Phrasal_template> used in the titles of
at
Post by Wayne Bickerdike
least 65 critical essays in computer science
<https://en.wikipedia.org/wiki/Computer_science> and related
disciplines.[1]
Post by Wayne Bickerdike
<https://en.wikipedia.org/wiki/Considered_harmful#cite_note-1> Its use
in
Post by Wayne Bickerdike
this context originated in 1968 with Edsger Dijkstra
<https://en.wikipedia.org/wiki/Edsger_Dijkstra>'s letter "Go To
Statement
Post by Wayne Bickerdike
Considered Harmful".'t the originator of "goto considered harmful".
I thought Michael Jackson defused it well it the 1970s with his
structured
Post by Wayne Bickerdike
programming book and methods. GOTO was absolutely necessary in many
cases.
Post by Wayne Bickerdike
I'll posit that most will agree and admit that some won't.
Post by David Crayford
Post by Seymour J Metz
That's a common beginners' mistake. Try putting the label inside a do
Post by Seymour J Metz
block and see what happens. A proper goto would pop what needs to be
popped
Post by Wayne Bickerdike
Post by David Crayford
Post by Seymour J Metz
Post by Seymour J Metz
and no more. See <http://www.rexxla.org/Newsletter/9812safe.html>.
Yes.
Continuation
REXX allows implicit continuation; a statement is treated as
continued if it
would otherwise be syntactically invalid. ...
???
Not in any Rexx I know. Is this perhaps a peculiarity of OS/2 Rexx?
And C has an improper GOTO. It allows branching into a block. It's implementation
dependent whether initializations are performed then. Ugh!
If you don't like those semantics don't use goto. My ROT is to only use
goto for branching to error handlers or cleanup routines.
If you look at the Linux kernel code including s390 you will see lots of
goto statements used just for that purpose. It's amusing to read threads
about what the maintainers think about this subject
http://koblents.com/Ches/Links/Month-Mar-2013/20-Using-Goto-
in-Linux-Kernel-Code/.
Post by Seymour J Metz
_______________________________________
Post by Seymour J Metz
From: Jack J. Woehr
Sent: Sunday, January 14, 2018 3:40 PM
Post by Seymour J Metz
REXX doesn't have a goto
Sure it does: SIGNAL
-- gil
--
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Wayne V. Bickerdike

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Pew, Curtis G
2018-01-18 14:12:33 UTC
Permalink
Post by Joel C. Ewing
One of the issues of ACM SIGPLAN Notices definitively resolved this
issue by suggesting that the any need for the harmful semantics of GOTO
statement could easily be eliminated by instead allowing a "COME FROM"
statement. I can't remember which year, but it was an April issue. :)
“COME FROM” was implemented in INTERCAL (http://www.catb.org/esr/intercal/)
--
Pew, Curtis G
***@austin.utexas.edu
ITS Systems/Core/Administrative Services


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Mike Schwab
2018-01-18 14:56:04 UTC
Permalink
And even made it to 99 bottles of beer.
http://www.99-bottles-of-beer.net/language-intercal-333.html

On Thu, Jan 18, 2018 at 8:13 AM, Pew, Curtis G
Post by Pew, Curtis G
Post by Joel C. Ewing
One of the issues of ACM SIGPLAN Notices definitively resolved this
issue by suggesting that the any need for the harmful semantics of GOTO
statement could easily be eliminated by instead allowing a "COME FROM"
statement. I can't remember which year, but it was an April issue. :)
“COME FROM” was implemented in INTERCAL (http://www.catb.org/esr/intercal/)
--
Pew, Curtis G
ITS Systems/Core/Administrative Services
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...