6 ms·
May I ask why do you want to learn modern C++? You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experi
by ronreiter 9y ago
May I ask why do you want to learn modern C++?
You should check out Rust, it aims to replace C++ and do a better job in memory management, and developer experience in general (cross-platform compatibility, package management, etc)
- maxxxxx 9y agoOne motivation to learn C÷÷ could be to find a job. Rust looks interesting but C++ is still vastly more popular.
- jxub 9y agoMostly because of adoption. Rust is great, but I'm not really into it (subjectively).
- deleted 9y ago[deleted]
- sjapkee 9y ago>replace C++ No one can replace it, but everyone has to try.
- bigcheesegs 9y agoRust is the first language I've seen that even has a chance though.
- yoz-y 9y agoLanguages rarely get replaced though. We are just adding to the pile.
- ahartmetz 9y agoOnly in a very strict interpretation that everything that is still used somewhere didn't get replaced. Perl was more or less replaced, for example, and I like that. The only kind of originality that is good in programming is "surprisingly simple". "Surprisingly weird" is terrible.
- oblio 9y agoYou're going to get at least 1 angry Perl programmer explaining that Perl is actually thriving and it's never been better to be a Perl programmer :p Which is actually partially true... the long tail of programming languages today is very, very big. There's probably 10-50x more programmers now than there were back in 1995. The programming world can probably sustain 10-20 mainstream languages these days, if not more.
- kamaal 9y ago>>Perl is actually thriving and it's never been better to be a Perl programmer :p Don't know about that. But only yesterday afternoon I spent like 2 hours writing a Perl script to heavy lift some Unix file work, Which I factored would take a week at-least to do in any other language. Perl is still largely a very useful language without any replacements. So are awk and sed. Web development world seems to have moved on to something else now.
- oblio 9y ago> But only yesterday afternoon I spent like 2 hours writing a Perl script to heavy lift some Unix file work, which I factored would take a week at-least to do in any other language. I'm guessing you're more familiar with Perl, because I personally find it hard to believe that Perl by itself is an order of magnitude more efficient to write than Python or Ruby.
- cmollis 9y ago+1
- ahartmetz 9y agoYup. D had a shot, but they screwed it up with (effectively) mandatory garbage collection. Ada also had a shot, I think, but they screwed it up with no C compatibility and expensive SDKs - or something. For some reason, Ada is just not perceived as "cool". It actually seems like a pretty good language!
- pjmlp 9y agoThe issue with D is not mandatory garbage collection, rather its quality and anti-GC religion. Joe Duffy mentioned on his Rustconf talk that Windows devs even with Midori running in front of them, it was still a very hard sell for them to psychology accept it as doable. The problem with Ada was basically expensive SDK, Pascal-like syntax and not being part of OS SDKs. Only systems programming languages that are bundled with OS SDKs survive on the market, others either get a niche (Ada - high integrity systems) or fade into oblivion/maintenance (Modula-2, Delphi, ...). The main reason being, companies already payed for OS SDK or gotten it for free with the OS. Any other language must add a very worthwhile set of benefits for them to look beyond the SDK and possible toolchain integration issues.
- AnimalMuppet 9y ago> Only systems programming languages that are bundled with OS SDKs survive on the market... Hmm. To Rust, this would seem to say "get bundled or die". In your view, is it enough to be a free download?
- pjmlp 9y agoI don't see a free download as being enough. At very least, there needs to exist painless interoperability with the SDK toolchain, debugging tools, IDE, platform libraries. Every piece of the puzzle that doesn't quite work like the SDK tools, means additional development/debugging effort. Naturally the big question is always if the added benefit of using language X outside the expected workflow outweighs the extra development costs. Just look at C++, it was on the path of being widely adopted by desktop OSes, every C compiler vendor was adding support for it. Then BSD and Linux large scale adoption happened with GNU manifesto favouring C as the language to write portable software, Java and .NET came into the scene. Microsoft was probably the only major OS vendor still caring about it, until LLVM happened and the wind started blowing again with C++11. The embedded space is still an area where C++ is hardly seen, with a few conference talks last year discussing on how to advocate for it. Now all major C compilers are written in C++, but had Microsoft focused only on .NET or LLVM never happened, and history would probably followed another path.
- Froyoh 9y agoJava?
- pjmlp 9y agoRust still needs to catch up with C++ in a few domains. SIMD, GPGPU, GUI, embedded platforms, iOS, Android, UWP, COM, certified compilers, ...
- xfer 9y agowhat do you mean by "certified" compiler here?
- pjmlp 9y agoIn certain industries, specially where human lives are at stake you can only use certified compilers, where the kind of code they generate is validated against specific safety standards. For example, https://www.iar.com/iar-embedded-workbench/certified-tools-for-functional-safety/ https://www.iar.com/iar-embedded-workbench/certified-tools-f...
- hsivonen 9y agoAs a programmer using the compiler, how does the IAR compiler quality feel in practice compared to GCC or clang?
- pjmlp 9y agoI never used IAR, given my focus on writing safe software I try to be up to date to these areas, and ways to somehow write secure software in C and C++. like MISRA and Frama-C. Maybe someone else can jump in. However, I can tell you that in general proprietary compilers for embedded devices make Visual C++ feel state of the art, let alone when compared with gcc or clang. Many of them are stuck in partial support for C99 or C++98 (e.g. TI), with no clear roadmap of future improvements.
- steveklabnik 9y agoIncidentally, SIMD is just waiting on stabilization now; it’s RFC was accepted and the implementation landed. Soon!
- deleted 9y ago[deleted]
- cpburns2009 9y agoI'm not the OP, but I'm tempted to learn more C++ so that I can directly use Qt without relying on language bindings for it. I like the idea of Rust, and maybe some day I'll tinker with it, but it looks like it has quite the steep learning curve.
- steveklabnik 9y agoFirst of all, I should say that I feel like bringing up Rust in this thread is inappropriate, and I’m glad the OP was downvoted. To comment briefly on the learning curve, the trade off is basically, C++ is easier to get started, but harder on the high end. Rust is a bit harder for C people to get started, but then the high end is much easier. Rust’s curve is flatter, in a sense. Oh and also: learning one will certainly help you learn the other in many cases. I advocate learning many languages :) This week I’m visiting a ~700 person company in London that’s moving away from C and towards Rust. They’re not doing a Big Rewrite, obviously, so they still have quite a bit of C too. They chose Rust over C++ though. It always depends!
- carlmr 9y ago>Oh and also: learning one will certainly help you learn the other in many cases. I advocate learning many languages :) Especially the Rust borrow checker will make you mad in the first place, and then teach you something about memory management you will be able to use in C++. It really improves your mental model in places you didn't expect.
- cmollis 9y agodoes Rust basically have the same 'move' semantics as C++ ?
- steveklabnik 9y agoYes and no. The idea is the same, the implementation is very different. Rust is “move by default, move always means memcpy (and they often can be elided), no move constructors,” to (possibly too) succinctly describe it.