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.
Related
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 4 years ago.
Improve this question
Today I was listening to a number of talks about dark sides of C++. One them was held by a man who was participating in the creation of the new C++ standard (Nikolai Jossutis). I'm fascinated by the many things in language, which make it easier to misuse. And for me personally it seems that C++ is actually fine if there wasn't backward comparability, which didn't allow to fix "bugs in the standard".
Hypotethically let's say I want an language dialect of C++ that is not backward compatible with the standard C++. It removes components considered dangerous, it doesn't compile something which is almost always results in UB.
I don't want to give any concrete examples, but I'm fine with everyhing which will make code safer. I already treat warnings as errors in the strictiest provided by the compiler way and use static analysis, along with ASan, etc..
UPD: I'm speaking about something very similar to C++ and it's characteristics. If I think about Java, it isn't suitable for me, because of VM. I'm asking about dialect of C++, not very different language, like Java or Rust. Rust is fine, because it compiles to native code, but I'm asking about dialect, not new language.
you could try D https://dlang.org/...
Or have a look at the Misra C++ rules https://www.perforce.com/resources/qac/misra-c-cpp, there are also code checkers available
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
Well, i was learning, again, a little bit of c and was with a little curious about how did the C++ inventor made it. And some facts lead me to the information, that he created it using pure C(obviously), so i was thinking if there is any source or anything that could help me to do things in C, that i can do in C++, like templates, namespace, class, reference and others it doesn't matter how difficult it is, i want to at least have more notion, so if anyone know a reliable source and well written i would be glad.
Yes, many, many years back, the first C++ compiler, by Bjarne Stroustrup was a "frontend for a C compiler".
Today, it certainly isn't anywhere like that. Modern C++ compilers generate code directly from C++ constructs in intermediate form for the backend to process into machine code for the target. This allows the compiler to do a more direct job, and not rely on the C compiler "understanding" what is going on.
This page contains some reference material on the cfront:
http://www.softwarepreservation.org/projects/c_plus_plus/index.html#cfront
That page also has links for the 3.0.3 archived sources as unpacked and compressed form.
Note however that this release is 21.5 years old, and would thus, if it was a person be able to order alcohol in a US Bar after showing ID. This is NOT the modern standard C++ by any measure (and it may or may not generate code that is suitable for a modern C compiler, I have no idea)
With this quote to go with the 3.0 release from 1991:
Bjarne Stroustrup notes, "A warning that Cfront 3 is pre-standard and
emphatically not recommended for use or further development might be
in place."
Edit:
I did download the code in the (compressed) link above. It certainly doesn't compile on Linux without effort. More effort than I am willing to spend, really. One of the problems is that it's pre-ANSI C, so the compile complains about various functions not being declared (for example strcpy, strcat, etc), and there are OS choices, none of which is Linux.
I also don't think it is necessarily the best place to start learning compiler techniques.
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.
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.
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 2 years ago.
Improve this question
which library would you advise me to use? I don't know any of these libraries.
I heard, that Boost is very often used but also it's hard to code in.
So to make this question as objective as possible:
Just simply from the aspect of beginner programmer (I've coded ~1000 LOC in C++ in my life)
which library would be better to learn?
I'll be using it mainly for HTTP client.
The answer is bound to be subjective but with particular emphasis on for a beginner then I think POCO is clearly the way to go. It actually has some HTTPClient classes and once you get beyond the point of being happy that something works the code is clear enough to follow so that you can dig in and understand why it works if that is where things lead you.
POCO is well written OOP code and does not require much in the way of understanding templates and such. The classes are well integrated with one another, extensive, and the documentation more or less points you to the next (or previous) class that you need. You won't be dashing around 20 separate libs as Boost is likely to have you doing. (There is always time for that later!)