3 ms·
The semicolon thing is just something you need to get used to. In just cases, you can just write C-style with a statement per line if that makes more sense to y
by beatgammit 8y ago
The semicolon thing is just something you need to get used to. In just cases, you can just write C-style with a statement per line if that makes more sense to you. However, I've come to love the expression-oriented nature of Rust because I can sometimes convince myself that I'm doing FP when I'm writing Rust.
Maybe it just comes with practice, but I don't find it difficult to switch syntax. I do a lot of Go, Rust, and JavaScript, and each has some peculiar syntax. I do recall it being a bit of a pain when starting out, so perhaps you're still relatively new to Rust?
As for borrows, I guess I haven't had that much of an issue with it. I keep the documentation open while writing code, so I can quickly reference something if I need to. However, usually a borrow is needed if the type isn't expected to implement Copy (i.e. isn't a value type), and that rule of thumb works pretty well. However, whenever I get it wrong, the compiler is there to help.
There are a few things that I wish were different in Rust, but I imagine those differ for each person.
- ncmncm 8y agoYou mistake me -- omitting parentheses and semicolons was very, very easy to get used to. Too easy, in fact. It was very hard to get back to putting them where they are required in C++. I was continually omitting them. (Maybe an IDE would have helped.)