3 ms·
How to convince them: - Show them how classes makes things easier (automatic object management, some operator overloading, etc) - Show how the STL makes most
by raverbashing 9y ago
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
- jernfrost 9y agoWhy 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.
- raverbashing 9y agoI wouldn't, but C++ is an improvement over C in most situations and will fit situations where modern languages won't run
- deleted 9y ago[deleted]
- nocman 9y ago"- 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++.
- scj 9y agoI'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.