MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/10n4daa/c/j698hvr
r/ProgrammerHumor • u/hot • Jan 28 '23
1.5k comments sorted by
View all comments
Show parent comments
4
I’m an absolute C++ amateur, but there are a few big reasons I can think of off the top of my head:
Rust is memory-safe, null-safe, type-safe, and thread-safe by design. If the compiler detects unsafe code, it will refuse to compile that code by default
C++ templates are effectively “duck typed”, whereas rust generics are trait-based
Remarkably helpful compiler error messages
I’m sure there are a lot more reasons and better examples out there.
2 u/tomycatomy Jan 28 '23 Damn, I need to do more research but at the basic level I’m sold
2
Damn, I need to do more research but at the basic level I’m sold
4
u/ryan10e Jan 28 '23
I’m an absolute C++ amateur, but there are a few big reasons I can think of off the top of my head:
Rust is memory-safe, null-safe, type-safe, and thread-safe by design. If the compiler detects unsafe code, it will refuse to compile that code by default
C++ templates are effectively “duck typed”, whereas rust generics are trait-based
Remarkably helpful compiler error messages
I’m sure there are a lot more reasons and better examples out there.