41 points · by AndreyKarpov · 13y ago · 48 comments
coupled with the: "To be fair, this doesn't entirely replace decltype. auto doesn't perfect forward. But it seems to work as expected, most of the time" it goes a great way to instil me a sense of safety.
not.
that post should be taken as an example of why C++ has become a liability, and the day won't come too soon when this joke on the whole industry finally gets dumped like COBOL in the nearest ditch, along with the corpses of all the projects that made the mistake of actually using it.
if it were a living thing, I'd shoot C++ in the face to put it out of its misery.
Personally I want a better C and C++ satisfies most of what I want.
1. Type level polymorphism (generics/templates/etc)
2. Easier ways to manage memory (constructors/destructors, auto/shared pointers)
3. A modules system (namespaces)
4. Lambdas, etc to make life easier (C++11)
5. A standard library with useful data structures
6. Fast
It seems all to me all these haters still think that C++ is just C with classes, but C++ is a fairly vast language and OOP is just a small part.C++ is blazing fast, it has an elegant standard library and templates do make sense if you know what you are doing.
You are trying to use cutting edge features that aren't properly standardised yet and complain that the error message is a bit long? Granted, template error messages aren't always the one liner you are expecting, but they are readable.
wrong. I use it every day, on a fairly large code base.
obviously, for portability reasons, nobody working on the project is allowed to even think about C++11, as well as other headache-inducing features - and that includes a fair chunk of the standard library.
95 lines of error messages sounds terrible, no doubt. But which language is better in the real world? I am currently consuming a JSON web service written in Java, and I get no less than 30kb of stack trace back when something blows up. Rails' stack traces are filtered by default, but sometimes you still have to jump in there.
And C++ has the advantage that much of this can happen at compile-time.
I agree that almost everything about C++ is broken, but the verbosity of error messages is the smallest of it IMHO.
" but the verbosity of error messages is the smallest of it IMHO"
It's merely a consequence of the verbosity/complexity of the language itself
This doesn't mean that C++ doesn't have its uses, but for your sanity's sake don't use it for high-level metaprogramming.
Believe it or not, there are people (like me) who actually enjoy coding in C++.
Feel free to shoot C++ in the face. Don't forget to rewrite most of compilers and operating systems in use in the process.
Cascade a bunch of errors, end you'll soon be writing a script to analyse error output ;).
But it can't solve the core problem. It's simply the language. The lack of Concepts (or something similar) means that error messages simply refer to implementation internals of the Template you are using. Easily giving you a long cascade of error messages when it's in some Template that is used by the Template.
All of the sudden you have to look at implementation details of your standard library or something even worse such as boost. Just to figure out what the mistake was.
And there is nothing Clang or GCC can do about it.
So go ahead, I won't have a problem with a dead C++. :-)
You mean stuff like Unreal Engine... ?
How many years would you give it to stay ubiquitous? I bet on 15 years
What concerns me even more is that it must be pretty much impossible for a beginner to pick up C++ today.
There certainly are issues when learning C++. But I don't think it's impossible. A major concern is the fact that there was never a centralised website collecting good information and filtering out the crap. There never was a central Tutorial or Reference.
All the knowledge is hidden in very expensive books and worst of all there are many publishers simply spitting out piles of bad C++ books.
http://isocpp.org/ and http://en.cppreference.com/w/ are a huge improvement.
Stroustrup's book is a great introduction: http://www.stroustrup.com/Programming/ I wish he'd made it freely available. A lot of programming beginners aren't happy to pay $50-$70 for a book when they can go to other languages offering great beginner tutorials for free.
And C++11 is pretty new. So of course there is a transition period with books, articles, references catching on.
They don't need to know the complete language on day 1.
haskell, python, erlang, clojure, scala, d, go, lua… take the tasks one by one. the glue is C (but something like llvm-assembly might take it's place eventually)
I really miss the ability to compile to native code in most implementations for mainstream languages nowadays.
I am looking forward to D and Rust, but it will take ages before any of them really get into mainstream.
C, well I haven't touched it since 2001.
There's a simple solution, don't touch all the fancy and extreme language features, use the core, keep your sanity. I code in C++ professionally using Qt, the last time I wrote any code using anything overly fancy was probably when I was in University. It's often not needed, it's guaranteed to make your code base a nightmare, and it's usually horrid to read back over. If you're sensible and put some constraints on what you're doing C++ is a great language choice, but often people stray into using all these areas of C++ that basically make the code an unmaintainable mess.
(note, defining core as the things guaranteed to work on 95%+ of current compilers, if it's non-standard I would really, really thing twice about using it)
So yes, it is quite common to use syntax not available in other compilers. Most code is vetted against only one compiler to begin with.
I, and many others, have been writing code in Clang and GCC for years that could not be compiled in MSVC. But that code was standard c++11. This is experimental and people should be aware of that while using it.
I also think programmers do regret the decision. Unfortunately, that is unlikely to change, as the programmers regretting the decision almost always are not the ones who wrote the software. It is way rarer for a code base to move compilers within a project/team than for a team wanting to incorporate a third party library into their codebase/compiler.