4 ms·
If you're writing high performance software That sounds like a red herring. Can C++ be easily compiled for heterogeneous architectures and distributed systems?
by gngeal 13y ago
If you're writing high performance software
That sounds like a red herring. Can C++ be easily compiled for heterogeneous architectures and distributed systems? Does it support massive concurrency in the Erlang/Go style? Is it easily and efficiently vectorizable the way that APL was once? Somehow I've always felt that C++ can do "anything" at the cost of "being equally bad at everything". Regarding C++11, I really like Rob Pike's comment on how the creators of C++ seem to think that the problem of pre-C++11-C++ was that "it apparently didn't have enough features".
- SamReidHughes 13y agoGo's style is not the same thing as Erlang's style. And the answer is yes, if you're talking about Go's style. Your line about C++ not having enough features is cute-sounding but actually it's anti-intellectualism under the religion of minimalism.
- gngeal 13y agoYour line about C++ not having enough features is cute-sounding but actually it's anti-intellectualism under the religion of minimalism. First of all, it's not my line, it's Rob Pike's line. Second, upon seeing how the C++ people intend to fix deficiencies of C++ by throwing even more features at it, it's very difficult to see it in any other way. Third, the only "anti-intellectualism" I see here is named C++: It's actually symptomatic of certain organizations that instead of trying to see the big picture and really fix things in a systematic way, they "anti-intellectually" hack and tweak and tinker and micro-optimize. For example, IBM has been doing that in the 1960s with their HW architectures before they got their shit mostly together, which is why the ACS project failed, only for it to be rediscovered forty years later, with modern CPUs finally (!) utilizing these ancient but very well working techniques, such as superscalar out-of-order design that will celebrate its fiftieth birthday in a few years. Now, the same breed of people who ditched ACS in the 1960s are apparently in charge of design of mainstream languages. I wonder if we'll survive the next decades in good mental health before enough people realize the same thing again, ditch that crap and start all over again.
- SamReidHughes 13y agoSo. If C++11 is so bad, how would you make a language backwards-compatible with C++ that solved many of its problems?
- csmuk 13y agoClearly he would invoke the flying spaghetti monster to intervene...
- orclev 13y agoI wouldn't. You can't build a solid structure on a broken foundation, and C++ is most definitely broken. Instead you throw it away and start fresh. The problem with C++ is it tried to combine the power of C with more advanced features while still maintaining all the low level access that C gives you. The problem with that is that it undermines all the advanced features by either allowing you to easily break them in odd ways through low level features, or else by leaking low level details all over your high level abstractions and requiring you to keep track of all those details the abstractions were meant to hide in the first place. If you want to see how to do a "low level" language better look at the approach that Rust, D and to a lesser extent Go, have taken. They borrowed from C where it made sense, and they threw away what didn't fit well. C++ kept not only the good, but the bad and ugly as well.
- kohanz 13y agoThis digression doesn't really answer the question of the OP, whether C++ is worth learning. I don't share your opinion, but even if I did, the answer would be a strong yes. A much larger quantity of important problems are being solved today with C++ than, say, Go. For employability, it's obviously worth learning (unless you're just doing web stuff). Even if you believe it's broken, it's worth learning to understand why it may be broken and to about those "mistakes" in the future.
- orclev 13y agoOK, fine, C++ is worth learning to learn what not to do, BUT, only after you've learned every other language out there. It's a waste of time to learn it before other languages because you won't have the background necessary to really appreciate how bad the language is otherwise. You might actually think it's a good language and never bother learning all the other better languages out there. Also, anything that reduces the supply of C++ programmers available for businesses to hire is probably a good thing. Fewer C++ programmers means fewer C++ programs and fewer C++ libraries, so hopefully they'll finally start writing frameworks in something other than C++.
- jejones3141 13y agoDijkstra's critique of PL/I from "The Humble Programmer" could be carried over essentially unchanged to C++: "Finally, although the subject is not a pleasant one, I must mention PL/1, a programming language for which the defining documentation is of a frightening size and complexity. Using PL/1 must be like flying a plane with 7000 buttons, switches and handles to manipulate in the cockpit. I absolutely fail to see how we can keep our growing programs firmly within our intellectual grip when by its sheer baroqueness the programming language —our basic tool, mind you!— already escapes our intellectual control. And if I have to describe the influence PL/1 can have on its users, the closest metaphor that comes to my mind is that of a drug. I remember from a symposium on higher level programming language a lecture given in defense of PL/1 by a man who described himself as one of its devoted users. But within a one-hour lecture in praise of PL/1. he managed to ask for the addition of about fifty new “features”, little supposing that the main source of his problems could very well be that it contained already far too many “features”. The speaker displayed all the depressing symptoms of addiction, reduced as he was to the state of mental stagnation in which he could only ask for more, more, more... When FORTRAN has been called an infantile disorder, full PL/1, with its growth characteristics of a dangerous tumor, could turn out to be a fatal disease."
- csmuk 13y agoWell all of those solve concurrency and scale problems in the VM and build a language on the top. C++ is just a language in which you are free to build those abstractions into in any form you choose. Batteries aren't included but are easy to construct. If that wasn't possible, then our SQL server installation (all c++) wouldn't quite happily run a single process on each of our 48-core nodes with 128Gb of RAM, nor would it cluster and replicate amongst all 8 of them and deliver 10,000 queries a second whilst yawning. Cats can be skinned in a multitude of different ways. No specific knife is required but some experienced knife-wielders are more important. Rob Pike is pretty cool but has blinkers on as he's a captive research executive rather than someone with dirty hands on the ground in some enterprise outfit.
- gngeal 13y agoWell all of those solve concurrency and scale problems in the VM and build a language on the top. I think you're quite mistaken here. These languages solve concurrency at the language semantics level, and then, some of them implement the semantics in a VM, but the VM (in case of Erlang, no Go implementation in use has one) is a tangential issue. To say that these language "solve concurrency problem in the VM" simply doesn't make sense. Languages are languages, they are not implementations. C++ is just a language in which you are free to build those abstractions into in any form you choose. Well, there's Turing completeness, and then, there's actual usability. Consider transactional extensions, for example. Haskell gives you a type system for that. In Lisp, you could achieve the same using a code-walking macro library. C++ gives you...what, pattern-matching based template metaprogramming? Ugh! The "language" for that, while Turing-complete, isn't even identical to the one used for run-time code. I've seen a factorial written that way. I don't want to imagine how more complex code like that must look like in C++. Even D is better at that! If that wasn't possible, then our SQL server installation (all c++) wouldn't quite happily run a single process on each of our 48-core nodes with 128Gb of RAM, nor would it cluster and replicate amongst all 8 of them and deliver 10,000 queries a second whilst yawning. I didn't say it's impossible in C++. It's just that it's masochistic, that's all. You could easily argue along the same lines that COBOL is a well-designed language because millions of applications have been written in it that power the reliable day-to-day operation of banks you've invested your money into. Yes, they have been written, but at what human cost? Rob Pike is pretty cool but has blinkers on as he's a captive research executive rather than someone with dirty hands on the ground in some enterprise outfit. "Captive research executive?" What does that even mean? He certainly has more than enough of his share of dirty hand, while continuing doing so even today, and I won't even comment on that "enterprise outfit" nonsense.