4 ms·
While I admire the amount of thinking that went and still goes into C++, for me the question is opposite: why ever C++? It seems to me that trying to improve a
by zoul 11y ago
While I admire the amount of thinking that went and still goes into C++, for me the question is opposite: why ever C++? It seems to me that trying to improve a language by ecosystem or convention will always be worse than using a language already designed around what we have learned and what has changed since C++ was born.
If somebody really needs to have the performace or be that close to the hardware, they can still probably find a better language today (Rust, Go?). But all others will certainly be better served by more modern, higher level languages. Just reading the examples in the PDF makes my head hurt.
- santaclaus 11y ago> they can still probably find a better language today Rust's ecosystem is still a bit anemic. I've played around with Rust, and I like the language, but C++ has a much wider array of battle-tested libraries at one's beck and call. Rust's development tools are also somewhat of a monoculture, at the moment.
- arnorhs 11y ago> Rust's development tools are also somewhat of a monoculture, at the moment. Care to elaborate? I'm curious
- jgh 11y agoFor us we support multiple platforms (win, osx, ios, android, ...) and need to interact with hardware io, codecs, and gpu apis. We could use C, I suppose, but we'd be giving up some of the niceties of C++11 such as smart pointers that make life much simpler. That's not to say we don't have some platform-specific code in the "preferred" language (in some cases there is no choice in the matter), but most of the system is C++.
- exprI 11y agoConsidering how much more resources programs use by the day, would you really like to run an OS written solely in, say, Python? Moore's law is coming to an end. It's only preferable that programmers use more efficient languages, even if happens at a mental cost. It's also more environmentally friendly.
- Coding_Cat 11y agoIn my limited experience, unfortunately Rust isn't there yet for true "blazingly-fast" low-level code, not without using assembly[1] or linking to external code. For example, there is no (mature) support for SIMD yet. Neither C or C++ has it to be technicall, but at least the compilers do (in the form of intrinsics). But I agree with the overal message, and I'm looking forward to Rust maturing. I think it is the better language although I am no expert at either. [1]: but really, when you start using AVX instructions and the like beyond what the compiler will automate for you, you are just using wrappers around assembly instructions in languages like C today anyway (__mm256_shuffpd, __mm256_perm128f2d)
- cbsmith 11y agoDid you just mention Go and performance? ROTFL! Writing in other languages means you end up using ineffecient abstractions. C++ affords very efficient abstractions and really doesn't force a different code structure than other languages, so it is hard to see why there'd be an advantage with something else.
- CJefferson 11y agoMy main argument against Rust is the existence of D. Over the years several languages have been the 'C++ killer'. For quite a long time it was D, and I know several people who converted. Then the standard library split in two, and the language got fairly unusable for a while. Now things have calmed down with D 2.0, but it's not clear it will still be around in 10-15 years time. Similarly with Rust -- at the moment it seems to be a one company product (Mozilla). What if they get bored of it? Will my Rust code still work in 10 years time?
- x0x0 11y agoI asked about this and some Rust folks were kind enough to mention that Dropbox is one company that publicly has a large Rust deployment. Further, I think the main (huge?) advantage of Rust is it was designed to allow in situ replacements of pieces of a large c++ codebase. This really is a killer feature for lots of folks who simply can't afford to rewrite tens of millions of lines of tested c++. previous discussion: https://news.ycombinator.com/item?id=10890310 https://news.ycombinator.com/item?id=10890310