4 ms·
The one thing I wish I could do for people coming into Rust is hand them "Programming Rust" and say "Read this. No, I mean it." Rust is NOT a Stack Overflow s
by bsder 6y ago
The one thing I wish I could do for people coming into Rust is hand them "Programming Rust" and say "Read this. No, I mean it."
Rust is NOT a Stack Overflow snippet language. Attempting to do so will get you into trouble.
Rust does NOT like pointer magic very much. If you try to be too clever with pointers, you will fight with Rust.
That having been said, I really don't fight with Rust all that much. I don't understand everyone complaining about the borrow checker, but, then, I've been doing embedded C for a very long time now. So, a lot of my bad habits have been ground out of me--quite often very painfully--by chasing subtle bugs in production devices.
After a couple of those experiences, you begin to write very different C code.
- moldavi 6y agoFrom what I've heard, the borrow checker is much more suited to low-level programs like embedded programs, and for other kinds of programs, the borrow checker is in the way a lot more. That could be why you don't understand the complaining (if they are correct, that is).
- bsder 6y agoI will also say that the compiler has gotten MUCH better about flagging what the real problem is over the last couple of years. Even 3 years ago, the error messages were much less forgiving. I also found that people tried to solve lifetime problems with the wrong tools. Normally everybody reaches for & and mut and * in Rust but very few people pointed out that an extra set of {} in the right place was more likely to solve or illuminate the problem.
- MR4D 6y ago> Rust is NOT a Stack Overflow snippet language That is a great line! Bad news - I just realized that I’m a stack overflow snippet programmer.