Re: Modern C++

2017-04-18 Thread mike smith
On Wed, Apr 19, 2017 at 11:34 AM, Greg Keogh  wrote:

> Haven't used printf or scanf (or their friends) in ages.
>>
>
> They were the first things to be highlighted when I compiled my old source
> for the first time.
>


Not much of that around for windows code now


> I also wanted Unicode support like we're used to with the managed String
> class, but I wasn't sure what the latest C++ convention was for this. I
> went searching and came across conflicting information. Some recommended
> the STL string, some pointed to safe replacements for all the old
> dangerous 'str' functions, then I found various macros like U("") for
> defining Unicode strings. At this point I became irritable and didn't know
> what to do.
>
> Have you got a convention for defining and manipulating strings in your
> C++ code? Is there a reasonably widespread convention at all?!
>
>
We went thru and converted it all to L"something" where it was embedded
(and we minimise that, as it's freaking hard to regionalise that way) and
if we manipulate raw strings with C++ we use the safe forms of strcat -
compile with warnings as errors points out the ones you miss.  Most of our
string stuff, though, has a internal string class that wraps the boost
stuff.  And includes toAscii and vice versa stuff.  BOMs on files can be
annoying.




> *GK*
>



-- 
Meski

 http://courteous.ly/aAOZcv

"Going to Starbucks for coffee is like going to prison for sex. Sure,
you'll get it, but it's going to be rough" - Adam Hills


Re: Modern C++

2017-04-18 Thread Greg Keogh
>
> Haven't used printf or scanf (or their friends) in ages.
>

They were the first things to be highlighted when I compiled my old source
for the first time. I also wanted Unicode support like we're used to with
the managed String class, but I wasn't sure what the latest C++ convention
was for this. I went searching and came across conflicting information.
Some recommended the STL string, some pointed to safe replacements for all
the old dangerous 'str' functions, then I found various macros like U("")
for defining Unicode strings. At this point I became irritable and didn't
know what to do.

Have you got a convention for defining and manipulating strings in your C++
code? Is there a reasonably widespread convention at all?!

*GK*


Re: Modern C++

2017-04-18 Thread mike smith
On Tue, Apr 18, 2017 at 4:57 PM, Greg Keogh  wrote:

> Not missing C++ because I'm still using it day-to-day :)
>>
>
> How's the experience? Using all the new fangled styles, libraries and
> compilers that appeared in the last 14 years? -- *GK*
>

Using boost in lieu of std, running with VS 13 and 15.   Haven't used
printf or scanf (or their friends) in ages.

Some of the testing tools with the compiler are rather neat (coverage,
analysis, optimisation after running)


-- 
Meski

 http://courteous.ly/aAOZcv

"Going to Starbucks for coffee is like going to prison for sex. Sure,
you'll get it, but it's going to be rough" - Adam Hills


Re: Modern C++

2017-04-18 Thread Greg Keogh
>
> Not missing C++ because I'm still using it day-to-day :)
>

How's the experience? Using all the new fangled styles, libraries and
compilers that appeared in the last 14 years? -- *GK*


Re: Modern C++

2017-04-18 Thread mike smith
Not missing C++ because I'm still using it day-to-day :)

On Tue, Apr 18, 2017 at 11:50 AM, DotNet Dude  wrote:

> I miss C but not C++ at all
>
>
> On Tuesday, 18 April 2017, Greg Keogh  wrote:
>
>> Folks, those of us writing managed code in here should be really
>> grateful. I know because on the weekend I tried to resurrect some of my C++
>> library code that has been untouched since 2003. Well ... everything has
>> changed thanks to the security review, Unicode, new standard libraries,
>> language features and compilers. It took me hours to get the old code
>> modernised to compile, but then I ran into incomprehensible linker errors
>> that I still haven't solved. So I'm not there yet.
>>
>> Then this morning I had to prove to a colleague who only writes C++ that
>> Azure Storage was usable from C++ programs without too much suffering
>> because I expected and hoped that helper libraries would be available. I
>> found good sample articles here
>> 
>> and here
>> ,
>> and I eventually made a simple working sample, but it was hell. The
>> namespaces are unfamiliar, the iterators are cryptic, there are new magic
>> string macros, but worst of all is asynchrony via the pplx library. In
>> managed code we can just await or let! bind for asynchrony, and the
>> language syntax is short and clear. I still haven't managed to get a single
>> async C++ function call to work yet.
>>
>> I was hoping that after all these years, and with the trend to "modern
>> C++" that things would be better, and I'm sure they are once you get the
>> hang of it, but the change in style, libraries, language and compilers
>> makes your 20th century C/C++ code experience mostly obsolete. Now I really
>> appreciate how lucky we are writing C# and F#.
>>
>> Here endeth the post Easter sermon.
>>
>> *Greg K*
>>
>


-- 
Meski

 http://courteous.ly/aAOZcv

"Going to Starbucks for coffee is like going to prison for sex. Sure,
you'll get it, but it's going to be rough" - Adam Hills


Re: Modern C++

2017-04-17 Thread DotNet Dude
I miss C but not C++ at all

On Tuesday, 18 April 2017, Greg Keogh  wrote:

> Folks, those of us writing managed code in here should be really grateful.
> I know because on the weekend I tried to resurrect some of my C++ library
> code that has been untouched since 2003. Well ... everything has changed
> thanks to the security review, Unicode, new standard libraries, language
> features and compilers. It took me hours to get the old code modernised to
> compile, but then I ran into incomprehensible linker errors that I still
> haven't solved. So I'm not there yet.
>
> Then this morning I had to prove to a colleague who only writes C++ that
> Azure Storage was usable from C++ programs without too much suffering
> because I expected and hoped that helper libraries would be available. I
> found good sample articles here
> 
> and here
> ,
> and I eventually made a simple working sample, but it was hell. The
> namespaces are unfamiliar, the iterators are cryptic, there are new magic
> string macros, but worst of all is asynchrony via the pplx library. In
> managed code we can just await or let! bind for asynchrony, and the
> language syntax is short and clear. I still haven't managed to get a single
> async C++ function call to work yet.
>
> I was hoping that after all these years, and with the trend to "modern
> C++" that things would be better, and I'm sure they are once you get the
> hang of it, but the change in style, libraries, language and compilers
> makes your 20th century C/C++ code experience mostly obsolete. Now I really
> appreciate how lucky we are writing C# and F#.
>
> Here endeth the post Easter sermon.
>
> *Greg K*
>