Having worked with C++ again for the first time in over 10 years, and coming from a stance of “dislike”, I can honestly say that C++11 is a better beast to work with than the C++ of old, but it is still a beast.
This FQA has lots of good stuff in it, but it’s disappointing that the link to the C++ FAQ Lite, which is the basis for the answers it questions, doesn’t appear to work. I looked at a copy elsewhere and things have been updated. Certainly some of the C++11 stuff is not addressed (for example, using delete on constructors to prevent copying).
Some of the criticisms in the Defective C++ section are mitigated by Clang these days, but by and large, what I’ve read so far seems to stand up, modulo some details.
That said, I work with LLVM which is rather picky about what parts of C++ actually get used. Were I in a hairier code base, I might see things with less rose colouring.
I did some C++11 last summer, for the first time since maybe 1994. The language is so much better it hurts. However, it remains leagues and leagues from a tool that I’d reach for. Maybe that’s because I largely avoid playing in the space where it is a reasonable choice, but if so, I’m pretty OK with that.
So, one of the smallest (and nicest!) things I found in the new versions of the language is the retooling of auto from specifying variable storage to using type inference. This make declaring iterators in for constructs a lot more palatable, and we don’t even have to do stupid typedef tricks anymore!
I think it’s good to note that the language isn’t actually so much better. Mainly because all of the old terrible stuff is still there. Maybe the portion you would use is better but it still doesn’t free anyone from having to use and understand the crappy parts of the language.
angersock, you really are on an anti-C++ streak these days, aren’t you? At least dig up modern criticisms of modern C++. The C++ FQA and the fake Bjarne anti-C++ interview are both really old.
I’ve never not been anti-C++, because C++ has never been (and will likely never be) a language worth celebrating. It’s a worse C than C, a worse Haskell than Haskell, a worse Java than Java, and so forth. It is a uniquely horrible chimera of features whose utility only somewhat outweighs its flaws. Judging the language on a new version based only on new behavior that’s been added (since, you know, old behavior and codebases haven’t really been removed) is dishonest.
That said!
The C++ FQA was one of my best resources when I was learning C++ ‘03, much the same as aggressive criticisms of
Javascript are actually very instructional. I posted this link for people who want to learn more about the language, as it’ll still be encountered in the wild for some time to come ('11 and '14 are fairly new). It clears up a bunch of questions that newbies have, and does so in a pretty entertaining fashion.
The fact that it has somehow survived the FAQ-lite is kinda telling. If you would like to help amend it, by all means, submit a pull request.
I’ll have a go, C++11/14/17 fix many issues and bring some new sorely needed features such as threads.
Great:
Threads finally added
Promises etc. to improve thread safety
auto/override/nullptr
enum class
lambdas
Filesystem support is finally coming in C++17
Clang warnings are phenomenal
Not great:
Still allows buffer overflows, reading past the end of arrays/objects, this is both a blessing and a curse.
No networking support (Boost ASIO or similar would be great)
Other libraries such as XML, JSON, CSV?, a basic HTTP server would be great. It is kind of a pain that many languages can create a server in a few lines, we need to import a library or write a few hundred lines of code to get something decent.
Thread safety even with promises etc. probably still needs improvement?
Override keyword is 100% optional for backwards compatibility (I would have made it required)
“enum class” should have been called “strongenum” or something else, I just don’t like the name.
Basically I wish they had added filesystem, threading and networking in say 2005 and I wish they didn’t care about backwards compatibility as much, even a “-cppstrict” flag for compilers to drop backwards compatibility would be great.
I’m sure there are more good and bad ideas in my head but I only spent 5 minutes on this.
Having worked with C++ again for the first time in over 10 years, and coming from a stance of “dislike”, I can honestly say that C++11 is a better beast to work with than the C++ of old, but it is still a beast.
This FQA has lots of good stuff in it, but it’s disappointing that the link to the C++ FAQ Lite, which is the basis for the answers it questions, doesn’t appear to work. I looked at a copy elsewhere and things have been updated. Certainly some of the C++11 stuff is not addressed (for example, using
deleteon constructors to prevent copying).Some of the criticisms in the Defective C++ section are mitigated by Clang these days, but by and large, what I’ve read so far seems to stand up, modulo some details.
That said, I work with LLVM which is rather picky about what parts of C++ actually get used. Were I in a hairier code base, I might see things with less rose colouring.
I did some C++11 last summer, for the first time since maybe 1994. The language is so much better it hurts. However, it remains leagues and leagues from a tool that I’d reach for. Maybe that’s because I largely avoid playing in the space where it is a reasonable choice, but if so, I’m pretty OK with that.
So, one of the smallest (and nicest!) things I found in the new versions of the language is the retooling of
autofrom specifying variable storage to using type inference. This make declaring iterators in for constructs a lot more palatable, and we don’t even have to do stupid typedef tricks anymore!I think it’s good to note that the language isn’t actually so much better. Mainly because all of the old terrible stuff is still there. Maybe the portion you would use is better but it still doesn’t free anyone from having to use and understand the crappy parts of the language.
Well, true. But I was able to get a lot done without having to deal with legacy nonsense.
angersock, you really are on an anti-C++ streak these days, aren’t you? At least dig up modern criticisms of modern C++. The C++ FQA and the fake Bjarne anti-C++ interview are both really old.
I’ve never not been anti-C++, because C++ has never been (and will likely never be) a language worth celebrating. It’s a worse C than C, a worse Haskell than Haskell, a worse Java than Java, and so forth. It is a uniquely horrible chimera of features whose utility only somewhat outweighs its flaws. Judging the language on a new version based only on new behavior that’s been added (since, you know, old behavior and codebases haven’t really been removed) is dishonest.
That said!
The C++ FQA was one of my best resources when I was learning C++ ‘03, much the same as aggressive criticisms of Javascript are actually very instructional. I posted this link for people who want to learn more about the language, as it’ll still be encountered in the wild for some time to come ('11 and '14 are fairly new). It clears up a bunch of questions that newbies have, and does so in a pretty entertaining fashion.
The fact that it has somehow survived the FAQ-lite is kinda telling. If you would like to help amend it, by all means, submit a pull request.
Yeah, every language needs one of these.
If you can’t articulate where your lang’s deficiencies are both in theory and practice, you’re not an expert.
I’ll have a go, C++11/14/17 fix many issues and bring some new sorely needed features such as threads.
Great:
Threads finally added
Promises etc. to improve thread safety
auto/override/nullptr
enum class
lambdas
Filesystem support is finally coming in C++17
Clang warnings are phenomenal
Not great:
Still allows buffer overflows, reading past the end of arrays/objects, this is both a blessing and a curse.
No networking support (Boost ASIO or similar would be great)
Other libraries such as XML, JSON, CSV?, a basic HTTP server would be great. It is kind of a pain that many languages can create a server in a few lines, we need to import a library or write a few hundred lines of code to get something decent. Thread safety even with promises etc. probably still needs improvement?
Override keyword is 100% optional for backwards compatibility (I would have made it required)
“enum class” should have been called “strongenum” or something else, I just don’t like the name.
Basically I wish they had added filesystem, threading and networking in say 2005 and I wish they didn’t care about backwards compatibility as much, even a “-cppstrict” flag for compilers to drop backwards compatibility would be great. I’m sure there are more good and bad ideas in my head but I only spent 5 minutes on this.