6 ms·
> Normal people don't want to touch C++ anymore. Only people that think that CVEs are "just fault of bad developers" (LOL) can still be considering C++ a good l
by ncmncm 6y ago
> Normal people don't want to touch C++ anymore. Only people that think that CVEs are "just fault of bad developers" (LOL) can still be considering C++ a good language to start new projects in.
Deliberately inflammatory, and also false.
1. Rust has limited abstraction features to make it more approachable and implementable, but make it unable to express libraries that are easy in C++. This will not change soon, although Rust will accrete features at a steady rate. But the gap in feature sets will widen, not narrow with time.
2. The total number of people using Rust in production is easily less than the number who pick up C++ in any given week. It will be ten years before Rust is a mature industrial language, if it gets there. (It has made a good start in that direction, which is better than can be said for any other newish language.)
3. C++ and Rust will coexist for decades. The most ambitious work will continue to be done in C++, while Rust will be more than adequate for what might otherwise have been done in (the much less capable) C, Go, or Java.
4. D fizzled because it is too similar to C++, and therefore unnecessary. Rust found a ready audience in people intimidated by C++, frustrated with the limitations of C, Java, and Go, and ready to try something wholly new. Its designers have threaded the gap deftly, uniquely adopting C++'s greatest strength, the destructor (which it calls the "Drop trait"), and avoided weighing it down with garbage-collection. It has a bright future if it can multiply its adoption rate by two orders of magnitude.
As Stroustrup said, there are only two kinds of language: the ones people complain about, and the ones nobody uses.
With enough luck, by the time Rust is mature, it will have gained plenty to complain about. Rust will have got somewhere when you read more complaints about it than brags about having made it do something already done in a mature language.
- tutfbhuf 6y ago> 3. C++ and Rust will coexist for decades. Nah, I mean maybe in the way that Fortran coexist with C/C++ for decades, but it's not equal coexistence. I would rather say that new languages arise, replaces old ones for most scenarios and in the cases where they can't, due to various reasons, they push the old language into zombie state like cobol.
- nix23 6y agoYou don't replace languages but program's, go into physic-space, fortran is alive an well, go into systems programming c is alive an well, go into business java is alive and well. It's the same BS like NoSql will kill all R-D's. You just don't invest millions just to rewrite programs that work's perfectly (and that's often the case with old battle-hardened software)
- lordlic 6y agoThe reason that RDMSes aren't dead isn't that they have too much momentum to be displaced by NoSQL. The reason they're not dead is that they're a good data model for lots of applications, and their consistency semantics and tooling provide real boosts to developer productivity.
- nix23 6y agoI know, but around 2009/10 every hipster programmer said RD's are a thing of the past..like C like Java etc...
- tutfbhuf 6y agoI think that NoSQL and SQL are so much different that they will equally coexist, in the same way that languages that are used for very different purposes like Java and Javascript can equally coexist. However, it is unlikely that we have 5 different equally popular languages for one specific domain (e.g. systems programming).
- tutfbhuf 6y agoI agree with you, so by zombie state I mean the languages are still being used, but for historic reasons (e.g. you don't want to rewrite), but no one really wants to start a new project in COBOL.
- nindalf 6y ago1. Could you give a few examples of libraries that can’t be made in Rust due to lack of abstraction compared to C++? GUI libraries apart, I can’t think of anything offhand. 2. True, but growth curves are rarely linear. Here’s a rough proxy on users - the number of subscribers to /r/rust - https://subredditstats.com/r/Rust https://subredditstats.com/r/Rust. Look at the growth between 2014-18 and 2018-2020. You’re extrapolating on current growth rate, but that may increase in future. 3. “Ambitious”. Nothing I’ve seen precludes using Rust for ambitious projects. In fact, seeing the experience of Dropbox, Mozilla, Facebook and others, there are some ambitious projects that could only have been done in Rust. I’m gonna say [citation needed]. I agree with Stroustrup and look forward to the day people complain about Rust :)
- papaf 6y ago1. Could you give a few examples of libraries that can’t be made in Rust due to lack of abstraction compared to C++? I'm guessing, but I think that something like Armadillo[1] would not be possible on stable Rust. Something like Catch[2] might also difficult to make ergonomic. I don't program in C++ anymore and I would personally live with the lack of expression/abstraction for a safer language though. [1] http://arma.sourceforge.net/speed.html http://arma.sourceforge.net/speed.html [2] https://github.com/catchorg/Catch2/blob/master/docs/tutorial.md#top https://github.com/catchorg/Catch2/blob/master/docs/tutorial...
- adamnemecek 6y agoWhy are they impossible in Rust? Are you aware of Rust's macros right?
- ncmncm 6y agoRust macros know nothing about types, but types are what do all the work at compile time.
- adamnemecek 6y agoDo they have to know about types?
- secondcoming 6y agoI've been writing C++ professionally for 16 years. I'm doing it right now in fact, but snuck on to HN while a build is underway. OP is right, unfortunately. C++ is a dying language. Mozilla, Microsoft and Google are all looking at Rust. Why? Because it's probably makes more sense to rewrite a buggy C++ component in Rust instead of updating it to use modern C++ (where admittedly, you have to go out of your way to get things wrong). The damage has been done. I'm also concerned about our ability to hire in the future. C++ devs will either be too expensive, or just not there since it's not an attractive language any more. I'm not a Rustafarian either, I've actually never used it but it would be negligent of me to not look at it. One concern I have with it is that the eco-system may be full of poor-quality ports of C/C++ libs, because that's how people work when they learn a new language.
- mantap 6y agoC++ was a dying language in the 2000s. But they turned it around with C++11. Now it has iterative 3 yearly updates and it's getting pretty good. It's far too premature to declare its death. The pace of development of C++ is decently fast and there's many stakeholders with millions of lines of C++ who are interested in C++ not dying. C++ is taught in universities around the world so the chance of C++ developers becoming expensive is low.
- Aeolun 6y agoThe C++ that they teach you in universities barely gets you started. I wouldn’t count on those for a steady supply.
- gnulinux 6y agoThe C++ they teach in universities is either just C, or putting Java spin on C (C-with-classes). I've never seen a decent "modern C++" class taught in universities.
- mantap 6y agoSure, but that's nothing a few years in the real world can't fix. The point is that C++ programmers are not some rare breed of neckbeard that are gradually going extinct. They are being produced en mass.
- rational_indian 6y ago>Rust found a ready audience in people intimidated by C++, frustrated with the limitations of C, Java, and Go, and ready to try something wholly new. What about people not intimidated by C++ and want to switch to Rust anyway? Why have you discounted them? Do such people exist in your world view? Do you think there might be a good reason for those people to choose Rust?
- lordlic 6y agoI read that the same way until I realized that it would be fair to say that even I'm "intimidated" by C++ despite having quite a bit of experience with it. It's not a matter of cleverness or experience. You can know something inside and out, and still admit that it's out of control and worry about the costs of its complexity.
- ncmncm 6y agoIf you are not intimidated by C++, you will be using those features that intimidate others to construct better libraries and programs than they can. Switching to Rust would mean a huge step down, where vast gaps in the feature set disable expressing what has been so easy. There are kludgy workarounds for everything, more or less, but why switch to a limited language with immature tooling and practically nonexistent immediate prospects, when C++ demand is going up, up, and up? Memory safety is just not an issue at the level where coders of modern C++ work. I have had exactly one lifetime error in five years, caught in initial testing. My bugs are overwhelmingly specification omissions and logic mistakes that Rust suffers from exactly as much. My day-to-day experience is to write 2000 lines and, when it compiles, it works correctly, modulo a "!" short or extra. Then, I spend a few days refining the design, which often means deleting code. Things Rust promises to help with consume only trivial attention. Library features not expressible in Rust prevent many more and bigger problems. Rust has some nice qualities I would rather C++ had--pattern match support, simple iterators, default const and default pass-by-move, sane conversions, sane initialization--but they are all low-level conveniences, not anything I am willing to trade away architectura-level capabilities for.
- rational_indian 6y ago
- Rochus 6y agoThank you for putting it so aptly. Unfortunately for many people technology is still an emotional rather than a professional topic.
- Aeolun 6y agoI think the two go hand in hand. I get emotional over many a professional topic.
- Rochus 6y agoThat's why we do tradeoff studies in systems engineering, to avoid that we take important decisions based on emotions or assumptions. Participants can still get emotional, but at least they have the facts and a process which converges to the optimum solution when followed.
- bigjake 6y agoExcellent explanation! Couldn't have said it better myself.
- isaiahg 6y agoAs a normal person learning and using C++ I'm sorry but I agree with him. If I weren't trying to get a job in the game industry I wouldn't touch it. I'm not a student either, I've been programming in multiple languages for over a decade. The language is messy and filled with undefined behaviors and unsafe methods by default. Where there are rules you can mostly ignore them whenever you want. People complain about JavaScript being messy but C++ is way worse. Though the language itself isn't all that bad, I don't understand why there so many build systems? And the top build system CMake isn't so much a build system as it is a build system for build systems that exists because no one can seem to agree on one. Many of these systems seem bloated and over designed by comparison when I can install libraries or cross compile in one line in go. I couldn't help but think there had to be a better way and it seems like rust is that way. I expect C++ will eventually go the way of Cobol and eventually be used to maintain legacy systems. p.s. thank God for vcpkg because I had nearly thrown in the towel while trying to integrate simple libraries until I discovered it.