News for hackers. Stuff that matters.
Re:Convincing C programmers to switch to C++: A look at huma... by raverbashing on Friday June 02, 2017 @11:47AM (#14470761)
How to convince them:

- Show them how classes makes things easier (automatic object management, some operator overloading, etc)

- Show how the STL makes most things easier (arrays, maps, etc)

How not to convince them:

- Show uses of excessive/pathological inheritance

- Use of templating beyond the basics

- Insist they use C++ functions for every single thing

- Insist they OOify every interface in their code

- Creating giant classes (structs) with a getter and setter for every field with no control or validation

- Going crazy with operator overloading

Re:Convincing C programmers to switch to C++: A look at huma... by nocman on Friday June 02, 2017 @12:03PM (#14470891)
"- Show how the STL makes most things easier (arrays, maps, etc)"

The problem with the STL is that you are always running into roadblocks when you try to compose things. I tried for a very long time to like the STL, and in the end it was very very good for one thing -- pushing me to look for something better.

I suspect things have improved some with the newer C++ standards (it's probably been almost 10 years since I gave up doing much of what I wanted to do in C++), but I much prefer Lisp, Scheme, and other languages now (most, if not all of them dynamically typed). Learning Lisp-family languages did indeed change how I program in other languages -- IMHO greatly improving the way I write code.

I might revisit C++ at some point, just to see what's happening there. I've only skimmed a few articles about the newer standards, and some things look promising. But it would probably take my involvement in a real-world project that uses C++ to get me to go there. I've just spent way too many frustrating hours trying to get things to work the way I wanted in C++.

Re:Convincing C programmers to switch to C++: A look at huma... by jernfrost on Friday June 02, 2017 @01:10PM (#14471560)
Why would that convince them of C++ and not any other modern language like D, Rust, Swift, Go or Nim?

I really can't see what C++ has to offer anybody. It is a horribly complex language, which doesn't interface with anything except C.

Re:Convincing C programmers to switch to C++: A look at huma... by raverbashing on Friday June 02, 2017 @04:20PM (#14472997)
I wouldn't, but C++ is an improvement over C in most situations and will fit situations where modern languages won't run
Re:Convincing C programmers to switch to C++: A look at huma... by scj on Friday June 02, 2017 @02:07PM (#14472079)
I'm going to flip the discussion a bit, and ask, what is a good use of operator overloading? What is a bad one? Is it possible to generalize the rules around good vs. bad cases (in order to make a programming standard others can follow)?

My experience is that I like writing code that uses operator overloading, but hate reading code that has it. Kind of like programming in Perl. In both cases, I find that on large projects, it is best to avoid the technology.