11 ms·
Rust is especially difficult if you bring your C-like assumptions to it. You first need to learn difference between a borrow (a view, which may be read-only) a
by pornel 9y ago
Rust is especially difficult if you bring your C-like assumptions to it.
You first need to learn difference between a borrow (a view, which may be read-only) and owned type, and know that Rust enforces stdlib strings to be UTF-8. Random mutation of a byte in a string is possible, but it has been deliberately put behind an unsafe function call, and there are better alternatives available (like char iterators).
It's not hard once you "get" the way Rust works with data.
- alkonaut 9y ago> Rust is especially difficult if you bring your C-like assumptions to it. To be fair it's very difficult if you bring your JS/Python/C#/Java assumptions there too. As a lifelong Java/C# dev, I just never imagined having objects on the stack. In C# knowing what goes on the stack is important - but the thing with everything stack is that it's copied - so it's basically just trivial values that sit on the stack. In Rust and C++ you can make entire complex applications whose data is entirely on the stack. And getting over that treshold is a big mental barrier. I'm used to just thinking of my app state as a blob on the heap. A functional programmer or a C++ programmer thinks differently.