5 ms·
I'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
by cpburns2009 9y ago
I'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.
- cmollis 9y agocool.. I didn't realize that move meant memcpy.. does this operation destroy the original object?
- leetcrew 9y agoif you aren't already very familiar with c, i would say the learning curves for c++ and rust are pretty similar. it will take you longer to get stuff to compile in rust, but correcting instances of undefined behavior in c++ can also take a long time in c++.
- cpburns2009 9y agoI know enough of the basics of C and C++, and their standard libraries to shoot myself in the foot with, and I'm sure invoke undefined behavior in the process (I do realize they are separate but related languages). Rust on the other hand appears to be a completely different paradigm from my primary experience which is in managed languages (e.g., Python, Java, etc.). In particular the borrow checker, while a marvelous idea, I think would pose a quite the challenge to get accustomed to.
- leetcrew 9y agoit's really not that bad. for a beginning programmer, the places where you would struggle with the borrow checker in rust have a lot of overlap with cases in c/c++ where you would struggle to fix all the errors reported by valgrind.