Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I very much prefer to work in Rust but it does force you to design things in an counter-intuitive way in certain situations (linked lists for the canonical example). Specially for lower level software I find C or C++ to allow for much more flexibility and thus the most straightforward design possible.
 help



I really don't think Rust does, but that's if you're outright refusing to use `unsafe` anywhere. Might be a little noisier if you're using things like ManuallyDropped instead of just using raw pointers, but the language doesn't stop you from doing things in ways you would with C or C++, it encourages you to encapsulate the hard parts so you can worry less about correctness of 98% of your codebase, instead of fearing incorrect behaviors can silently sneak in.

That's absolutely correct. Wild to see it downvoted without explanation, while you preemptively mentioned the tradeoff that you do need to worry about correctness in that case (just as much as in C/C++), but that only applies to a small part of your codebase, so it's still a huge benefit.

The only downside is that unsafe rust is more verbose than C/C++.




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

Search: