obviously we disagree! i think it's ok to miss out on language features.
templates, as you say yourself you're ok not to know. you're also not ok not to know exceptions.
there's other stuff too, you can get away without the C preprocessor. C++ is too big to know all of and it's a waste of time to invest time trying to, unless you are on a standards committee or are writing a compiler...(and even then you can get away with being a specialist!).
it's much better to be a program writer than a language lawyer and dare I say it: more satisfying too.
i draw a huge distinction between people that understand a language and people that can use a language, and i think people underestimate the time and effort in understanding a language. i think that time and effort could be better spent writing programs.
unless you are on a standards committee or are writing a compiler...
Or you work on an existing codebase. Most C++ code that I worked on had templates, exceptions, and used the C preprocessor.
I used to have your attitude. This works for many languages, e.g. if you know some of the syntax of Python or Go and the usual stuff from the standard library, you can get pretty far.
If you want to write modern C++, this is not really true. You need to know about const correctness, lifetimes, some templates, etc. Or you cannot deal with most projects or libraries, like Boost, Eigen, etc.
It's like saying you can program Haskell in 2014 without knowing typeclasses, lenses, GADTs, etc. You can write some educational form of Haskell, sure. But many libraries use these.
Modern C++ is a moving target. By the time you get around to doing a project with one set of features they've been made redundant. Exceptions are a good example of this with noexcept etc coming in and replacing what went before.
I know nothing of haskell. My point is that you should learn the features of the codebase you work on, and it's a waste of time to learn all features, ultimately for a codebase you are not working on or may never work on.
incidentally, ditto, i used to have your attitude.
obviously we disagree! i think it's ok to miss out on language features.
Sure, but there are a ridiculous number of edge cases which result in undefined behavior -- this is something that cannot be avoided when learning C++. You really need to understand what undefined behavior means and what precautions you need to take to avoid it. (Don't get me wrong, recent standards let you write code that's a lot less likely to run into UB, but you need to learn that from somewhere. You should definitely not be approaching modern C++ as an improved C!)
the edge cases are multiplicative, the more features you use, the more they interact. therefore by reducing language features that you use you reduce the number of edge cases you run in to. most shops agree on a subset of C++ before embarking on a project.
i didn't say to approach C++ as an improved C. you are more likely to learn undefined behaviour from compiler warnings than reading a merry array of 500 page books before sitting down to not finish a program.
The thing is that most of the things that your parent mentions are not just some theory. Exceptions, templates, and the C preprocessor are used in most real-life C++ code.
I think starting from somewhere with modern C++ means not starting at C strings, arrays, and bare pointers but starting with STL containers, STL algorithms, and smart pointers etc. to build good habits. But eventually any good introduction has to cover C arrays etc. as well.
Back when I started C++, Accelerated C++ was that sort of introduction. But AFAIK it's not updated for C++ 11 or 14.
I agree that picking a subset is the way to go. Google avoid two out of the three i mentioned that you take issue with avoiding.
Places I have worked the code is divided into libraries and coding standards per library are different to the whole. The point is to lazily learn the part that the codebase you are working on uses and get cracking rather than waste time getting book smart on parts you may never use.
Comments
obviously we disagree! i think it's ok to miss out on language features.
templates, as you say yourself you're ok not to know. you're also not ok not to know exceptions.
there's other stuff too, you can get away without the C preprocessor. C++ is too big to know all of and it's a waste of time to invest time trying to, unless you are on a standards committee or are writing a compiler...(and even then you can get away with being a specialist!).
it's much better to be a program writer than a language lawyer and dare I say it: more satisfying too.
i draw a huge distinction between people that understand a language and people that can use a language, and i think people underestimate the time and effort in understanding a language. i think that time and effort could be better spent writing programs.
unless you are on a standards committee or are writing a compiler...
Or you work on an existing codebase. Most C++ code that I worked on had templates, exceptions, and used the C preprocessor.
I used to have your attitude. This works for many languages, e.g. if you know some of the syntax of Python or Go and the usual stuff from the standard library, you can get pretty far.
If you want to write modern C++, this is not really true. You need to know about const correctness, lifetimes, some templates, etc. Or you cannot deal with most projects or libraries, like Boost, Eigen, etc.
It's like saying you can program Haskell in 2014 without knowing typeclasses, lenses, GADTs, etc. You can write some educational form of Haskell, sure. But many libraries use these.
Modern C++ is a moving target. By the time you get around to doing a project with one set of features they've been made redundant. Exceptions are a good example of this with noexcept etc coming in and replacing what went before.
I know nothing of haskell. My point is that you should learn the features of the codebase you work on, and it's a waste of time to learn all features, ultimately for a codebase you are not working on or may never work on.
incidentally, ditto, i used to have your attitude.
Sure, but there are a ridiculous number of edge cases which result in undefined behavior -- this is something that cannot be avoided when learning C++. You really need to understand what undefined behavior means and what precautions you need to take to avoid it. (Don't get me wrong, recent standards let you write code that's a lot less likely to run into UB, but you need to learn that from somewhere. You should definitely not be approaching modern C++ as an improved C!)
the edge cases are multiplicative, the more features you use, the more they interact. therefore by reducing language features that you use you reduce the number of edge cases you run in to. most shops agree on a subset of C++ before embarking on a project.
i didn't say to approach C++ as an improved C. you are more likely to learn undefined behaviour from compiler warnings than reading a merry array of 500 page books before sitting down to not finish a program.
I agree; sometimes you have to start somewhere. Then come back and improve knowledge. Trying to be a theoretical expert early on will bite you
The thing is that most of the things that your parent mentions are not just some theory. Exceptions, templates, and the C preprocessor are used in most real-life C++ code.
I think starting from somewhere with modern C++ means not starting at C strings, arrays, and bare pointers but starting with STL containers, STL algorithms, and smart pointers etc. to build good habits. But eventually any good introduction has to cover C arrays etc. as well.
Back when I started C++, Accelerated C++ was that sort of introduction. But AFAIK it's not updated for C++ 11 or 14.
I agree that picking a subset is the way to go. Google avoid two out of the three i mentioned that you take issue with avoiding.
Places I have worked the code is divided into libraries and coding standards per library are different to the whole. The point is to lazily learn the part that the codebase you are working on uses and get cracking rather than waste time getting book smart on parts you may never use.