Hacker News new | past | comments | ask | show | jobs | submit login

> like – maybe Rust is not for people who are already C++ experts and who are happy with C++? I don’t know!

I think Rust is very good for C++ experts. Some key concepts like ownership / RAII and etc. are well known in C++, and they should be easy to understand.




Yeah, people with C++ experience have an advantage when learning Rust, since they're used to these concepts, and the Rust compiler enforces things they already know to be careful with (like not mutating a container while there's a live iterator to it). On the other hand, Rust lacks some things C++ has like being generic over values instead of just over types, so for instance implementing a trait for every fixed-size array of a type is currently AFAIK not possible (the usual solution is to use a macro to manually implement the trait for every size up to 32).


Sure, there are differences as well, and there is no point in always mimicking C++ approaches in Rust 1:1. But I think overall, coming from C++ to Rust should be one of the easiest transitions.


As someone who's extremely comfortable with C++, I've tried Rust multiple times but keep bouncing off. Ultimately my problem is just that it doesn't have enough exciting features to lure me away, especially with C++ improving every few years.

Compiler-enforced safety and a built-in package manager are really nice, but it doesn't quite make up for the loss of a lot of handy C++ features.


Which features do you miss the most?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: