> I don't have a problem with using C++ as a better C.

Okay, fair enough. Perhaps I was being a bit of an OO snob. It's true. You get 
to pick and choose which features (of any language) suit your style and your 
set of problems.

You're going to gasp at this: I have not found a fondness for the C++ stream 
I/O for messages. I use "printf-style" I/O. I think it is better suited to a 
mainframe product style where all of the messages are organized and documented, 
not just whatever the programmer felt like writing in the particular situation.

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of David Crayford
Sent: Tuesday, May 30, 2017 2:08 AM
To: [email protected]
Subject: Re: Question about C++

On 30/05/2017 5:18 AM, Charles Mills wrote:
> Nearly any "Hello, world" program from the Web will run without modification 
> on z/OS, either as a UNIX command or as a conventional load module.
>
> ftp://www.cs.uregina.ca/pub/class/cplusplus/CExample.html
>
> z Linux is Linux, Linux, Linux. Nearly any Linux program should compile and 
> run without modification so long as it does not have "endian" dependencies.
>
> I've got a lot of C++ code but the bulk of it is proprietary. I have some 
> trivial programs but they are no more illustrative than anything you could 
> find on the Web.
>
> There are any number of C++ tutorials available. The IBM z C++ is totally 
> standard, albeit about six years behind the state of the art.

Indeed! only a subset of the C++11 standard has been implemented so far and the 
other platforms already enjoy C++17 which is almost as succinct as dynamic 
languages. At least we have type inference which Java doesn't yet. Especially 
good for iterators to swerve the boiler plate declarations:

for ( auto it = m_map.begin(); it != m_map.end(); it++ ) ...

C++ can be a very complex language with some gnarly edge cases. But if
you master the fundamentals it it's an incredibly powerful language.

> I learned Microsoft Visual C# which was easy -- great visual IDE -- and then 
> taught myself C++ from there. I think it was a good way to go. I learned true 
> object-oriented habits that way. Many people I fear claim they are writing 
> C++ but in reality are writing what I call "C with // comments."

I don't have a problem with using C++ as a better C. Some might use it 
just for scope based resource acquisition or a safe string library. Not 
everybody wants or needs OO abstractions. In a lot of modern C++ code 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to