4 ms·
I wonder how much C++ is being learned by new generations of programmers. I suspect Rust is taking over there but that is a completely baseless assumption on my
by rapsey 4y ago
I wonder how much C++ is being learned by new generations of programmers. I suspect Rust is taking over there but that is a completely baseless assumption on my part.
- AtlasBarfed 4y agoI was shocked to read in a thread today that C++ programmers are paid WORSE than javascript/python/webshit/scriptcrap. Which blew my mind, but the comments basically proved the case. That's the death knell. C++ will COBOL, not because it sucks (which I do think it kind of does due to feature overload and too much long history of different feature generations), but because it isn't even worth the money to learn.
- synergy20 4y agoAs one of the data points, I compared rust and c++ and started learning c++ seriously one year ago, modern c++ is much safer and simpler as far as I can tell.
- rapsey 4y agoA different data point. In the November HN hiring thread, Rust has more mentions than C++.
- karmakurtisaani 4y agoI'd be very eager to jump to a well-paying rust job that didn't involve web3 in any way. Sadly not too many of those near me yet, but one can hope..
- guardian5x 4y agoModern C++ is safer than old C++, but i doubt it is safer than Rust.
- P5fRxh5kUvp2th 4y agowhy do you doubt that? safe rust is organized just like safe C++.
- aldanor 4y agoSafe Rust prevents you from doing stuff, it just won't compile. More importantly, it prevents your dependencies from doing stupid stuff if they're forbid(unsafe). "Safe C++" you can segfault or mem leak in a single line. Good luck reading through a few dozen k lines of code of a 3rd party library to check if they adhere to every single convention of "safe C++".
- karmakurtisaani 4y agoAlso, "safe c++" is still c++. You can write it as safe as you want, but all it takes is one 3 month contractor to come shit all over you codebase and leave. If your company doesn't have enough resources to control what goes in at all times, you will easily get stuck with fixing someone else's memory leaks. At least rust has built-in safeguards against that.
- nequo 4y ago> you can segfault or mem leak in a single line. Good luck reading through a few dozen k lines of code of a 3rd party library You have articulated one of the biggest motivations I have for avoiding C++ in scientific computing. An R library that uses C++ to speed up a clustering algorithm that seemingly arbitrarily segfaults on my input is not the thing I should be having to debug.
- saghm 4y agoI think it's important to note that Rust can still leak memory in safe code. Memory leaks are not "unsafe"; they're a performance issue and could possibly lead to panics due to running out of memory, but panicking is not unsafe (i.e. it's deterministic and not a source of undefined behavior). Rust provides a lot of absolutely critical guarantees, and I fully agree that it's much safer than C++, but I think it's important not to overstate the benefits (not that you did say that Rust prevents memory leaks, but I worry that someone might incorrectly infer that due to the way it was mentioned for C++).
- Ar-Curunir 4y agoModern C++ can never be safer than Rust. It just doesn't have the static analyses to make that guarantee, and on top of that it has to interact with older C++ code that might not conform to modern best practices.
- synergy20 4y agotrue, but I do embedded, rust is basically static-stdlib-linked, which is too large for a resource-restricted board when you have more than one executables running, when rust can support shared libraries as c++ does, i will reconsider quickly.
- tomjakubowski 4y agoWhat do you mean? Rust has supported dynamic linking since before 1.0.
- synergy20 4y agoits own stdlib is linked statically by default.
- deleted 4y ago[deleted]
- yodsanklai 4y agoSomeone will have to maintain all that C++ code.
- acc_297 4y agocurrently completing a CS degree here - rust has yet to make it into classrooms (at my school) while C++ is still introduced I think professors mostly teach what is "industry standard" whenever they can - interestingly OCaml gets coverage in some classes because apparently some banks use it. Whenever big silicon valley company X starts using rust in a product major schools will follow.
- rapsey 4y agoRust is used at Google, Amazon, Microsoft, Apple, DropBox, Meta, Cloudflare and a bunch of others.
- jgrahamc 4y agoYes. But we also use Go, C++, Lua, ...
- chomp 4y agoWhat's used at a bunch of west coast companies doesn't make it ubiquitous.
- ilovecaching 4y agoSome of those companies have like 1 or 2 projects in Rust out of thousands. I mean most of them are running millions and millions of lines of Java and C++. Java and C++ aren't going away - ever.
- yodsanklai 4y ago> I think professors mostly teach what is "industry standard" whenever they can - interestingly OCaml gets coverage in some classes because apparently some banks use it. It's time consuming to start a class from scratch and professors prefer to reuse their material when they can, rather than learning/teaching something new. There may also be some inertia that makes it hard to change the core languages that are taught. As for OCaml, there's a lot of academic research around functional languages, and professors doing research in PL are happy to teach OCaml/Haskell.
- mkl95 4y agoI learned C++ to teach myself graphics programming. I'd expect the graphics students of the future to use Rust + Vulkan or something like WebGPU.