The differences between C++03 and C++14 [closed] - c++

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm Learning C++ and have taken a book, released in 2005, out from a library that teaches C++ using C++03.
Is the knowledge in this book still relevant at an intermediate level? Or should I get a more up to date book? If not, what parts that conflict with C++14 should I avoid?

The book still has value, as the core of the language is quite stable.
That said, if you are going to go to the trouble of working through a book, you should find a good book. And I would also find a newer book that will cover the latest changes.

First learn the fundamentals, then you can look at the difference between the newer standards. For that a page like Wikipedia can help.
Personally I think C++11 and C++14 introduced more advanced features than fundamental features.
For example, you first need to understand a normal for loop before you should try to understand the ranged-based for that came with C++11.
With that view, C++03 is a good starting point.

Related

Should I use the Guidelines Support Library (GSL) in a new C++ project? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
What are the pros and cons in favor of and against using the Guidelines Support Library (GSL) in a new C++ project? I find some constructs there very attractive but am a bit scared of including and relying on such a fundamental library.
The GSL is just a support library for the C++ core guidelines. If you are using the GSL, then these core guidelines should be the guidelines you apply to your code (not Google's or any other found online). You don't need the GSL for the core guidelines nor do you need to use everything in the GSL. Personnally I have started using it for simple bits like index and not_null.
The GSL is not perfect, there are many things that could/should be added, it doesn't impede me for doing crazy things, but it helps adding a framework/some kind of verification to what I'm doing. Also it removes the signed/unsigned issues with index.
I would advise to use it in a new project, as its run-time overhead should be null, but it's a matter of taste. If your project has lots of new developers (or toddlers), then it's something considering to help them growing up.

Why does Stroustrup in "The C++ Programming Language 3rd Edition (online)" define the function sqrt? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Bjarne Stroustrup, in 3rd edition (online) of his book "The C++ Programming Language" chapter 2, page 23 (pdf page 34), in a snippet paradigm, defines the function sqrt. Why does he not just use the one already included in the standard library?
Because sqrt is an example of a 'good style' procedural function. It takes an input, processes it, and returns the result.
The book is not suggesting that you should write you own, or to copy the definition from the book (which lacks the implementation entirely anyway). The book also isn't demonstrating how to calculate a square root. It is describing the purpose of functions in procedural programming (or that's my interpretation anyway).
And just in case you are considering writing your own sqrt(), take a look at some source code, e.g., the first that I found with Google:
https://opensource.apple.com/source/Libm/Libm-92/ppc.subproj/sqrt.c
ACCU's October 2016 Overload magazine has an article 'Eight Rooty Pieces'
https://accu.org/index.php/journals/2294
The bogosqrt() solution I found particularly amusing.

What's the preferred sequence to read Effective, More Effective & Effective Modern C++ (and STL)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I understand that More Effective C++ is an expansion of Effective C++, while Effective Modern C++ focuses on C++11 & 14. Being a newbie to the language and just starting out with these books, should I read Effective Modern after the first two? Also, where should Effective STL fit in?
What is the preferred sequence to reading the above books, in the sense that each book is building on the content of the prior books? (Assuming everything inside is new to me?)
Additionally, is Effective Modern C++ considered an unofficial next edition to Effective C++?
An answer to this can be gleaned from the Books, etc. summary page on Scott Meyers' website:
Effective C++, Third Edition, 2005. Scott's flagship book, and the
industry's must-read second book on C++ (i.e., what you read after
you've learned the fundamentals of the language)
Read this first.
More Effective C++, 1996. Still relevant after nearly 20 years!
Indispensable in its own right, and an invaluable companion to
Effective C++
Read this together with, or after, Effective C++.
Effective Modern C++, 2014. The book on effective use of the features
new in “modern” C++ (i.e., C++11 and C++14). A complement to Scott’s
existing books
Read this once you have mastered the concepts in the other two, as it is focused on the changes in the later versions of the language.
Effective STL, 2001. 50 specific ways to improve your use of the STL,
including techniques for improving performance, eliminating resource
leaks, avoiding portability problems, and more — all in Scott's
inimitable style
This one is less clear although I would suggest reading it after the first two and before the third.

C++ Primer (5th Edition) and C++14 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've recently bought the book C++ Primer (5th Edition) and I've noticed that the book is updated to the C++11 version and not to the latest C++14.
Is there anything that I need to do different to adapt myself to the new C++14?
I'm afraid that I'll learn things in the book that are no longer relevant, or not in the most efficient way, because of the differences between the versions and the additions to the C++14. If you could let me know if there is anything that I need to do differently to make my code more aesthetic or efficient, I would appreciate it.
C++14 is a so-called "minor update" to C++11. C++14 adds to C++11 and allows you to take a few more shortcuts and to write more like a script kiddie getting started with PHP.
There will be some minor gaps in your knowledge if you learn from a C++11 book, but nothing serious. There were no paradigm shifts in the interim, nothing substantial was removed, and you won't be left behind.
For any code usage that doesn't quite match up, you may simply refer to a decent reference. Again, for the most part, these are really very minor changes.

Recommended and updated opengl book [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am looking for a good updated opengl book :)
I have the Opengl Programming Guide 8th Edition, its pretty bad actually :\
all the source code example is a huge mess and some of the code just make's error's and whatnot (some of the examples even uses variable that was not even declared or typed in the wrong variable's.
What is the most recommended book that out now?
What is the most recommended book that out now?
That would be the OpenGL Specification. ;)
But seriously: you can't go wrong with the OpenGL Superbible in the latest revision (6th). Personally I stopped using the Red Book years ago and found the Superbible much more readable for beginners.
At some point, what now is a remark in jest, will become a reality: if you seriously want to get into OpenGL, there is no way around reading and understanding the actual specification.