Is it considered bad practice to use older versions of C++ for programs that will be distributed? Say, if I wanted to make a GUI app for my company that used the 1998 ISO C++ language standard, rather then a newer one like C++11. Or should I just stick to the newest ones. I have a book that uses C++ 1998 ISO Standard, so is that book too old to learn from? Thanks.
I don't think it's bad practice. The quality of a program doesn't depend on the language but on the skills of the designer, programmer and tester.
One of the best free database programs SQLite is still written in plain old C (150000 LOC)
I you have a book about 1998 ISO Standard then go ahead and use it unless you want to spend more money on new books. Your choice depends also on the compiler / IDE you want to use.
Use whatever version you need. Sometimes, you have no choice but to use an older standard, i.e: for compatibilty. Is it bad practice? Depends on how you follow the standard for that version of the language. For me, if you follow the standard, you retain platform independent code, which is considered good practice. Languages develop over time to include new features and change a few rules, although seldomly. Note that newer versions of C++ standardise data-types across multiple platforms, and using those is also considered good practice. Would I say it's bad practice to use older versions of C++? Certainly not, but you have to consider what is gauranteed and what isn't, such as initialisation rules and linkage.
IMO, the only good reason to use C++98 is if you are supporting a legacy code base or you're making a toy program that doesn't have any chance of surviving more than one iteration. Certainly if you're programming to cement your knowledge of C++, you should do so with modern C++.
Did you read my example about SOLite ? According to your theory it must be crappy.
Are there better versions of the same thing, available freely, that make impossible things possible, difficult things easy, and performs better? If so, then yes, it's a sack of crap by comparison.
I also disagree that my theory means it must be crappy. I believe you are misrepresenting my theory.
Also who makes the mistakes - the programmer or the tools?
That's really insightful. Could you write it down for me so I don't forget? Here, write it down on the back of this postage stamp using this banana.
I would go ahead and get a newer compiler. And you can use the newer compiler to with the older book to learn the language.
I doubt there is anything in the book that would break backward compatibility for the compiler. There are some niceties and efficiencies in the newer version of C++ that you won't learn from the book, but you can get a firm foundation in C++ from the book, and when you are ready to learn some of the newer features of the language, you will already have your compiler set up and ready to go.
I'd use C++11 if possible. It has some really nice features that aren't in C++98 including
- unique_ptr and shared_ptr.
- move semantics mean that the standard library is much more efficient.
- ranged for loops are more convenient to write and easier to read.