News for hackers. Stuff that matters.
Re:Programming in Rust: the good, the bad, the ugly by ncmncm on Tuesday March 12, 2019 @08:15PM (#19374415)
It sounds like Rust could be a good way to break one's bad habit of depending too much on their IDE.

Pity that won't last.

The biggest problem I had with Rust was that I found it very, very hard to go back and forth between Rust and C++. Rust forbids or discourages use of semicolons and parentheses in many places where C++ requires them, and it took days to restore the habit of putting them in. I finally had to stop experimenting with Rust because it was interfering with getting paid work done. People coding only Rust, or Rust and (say) Ruby, should be less affected.

At the time, it was quite hard to know where an & was required, and where it was forbidden. There wasn't much middle ground, suggesting maybe it would do better figuring that out for itself. But it is probably too late to change that. Rust left behind a huge number of C's legacy mistakes that C++ had to suck up, but it is increasingly limited by its own early choices.

Re:Programming in Rust: the good, the bad, the ugly by beatgammit on Tuesday March 12, 2019 @10:59PM (#19375302)
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.

Re:Programming in Rust: the good, the bad, the ugly by ncmncm on Wednesday March 13, 2019 @01:53AM (#19376095)
You 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.)