by rapsey · 8y ago · 0 comments
Or maybe writing correct (i.e. safe) code is more difficult then most programmers realize and they lack the humility to admit it.
OP wants to be fast and "productive", but forgets that in systems programming your first priority is good design and solid implementation. This is because _other_ components will be relying on your code to do their job. It pays to go extra step and make sure your component is properly written. Rust offers more than any other systems language to help with that.
The borrow checker is not just some crazy torture device that exists for no reason. Criticizing the difficulty of the borrow checker without considering why it exists in the first place is completely misguided.
Teaching people to keep this in mind is a hard problem.
One of the reasons I love functional programming is it allows me to think less about edge cases, because values are passed as values.
If Rust passed copies instead of references by default, people who wanted performance could fight (or embrace, whatever your preferred term/level of experience is) the borrow checker, while everyone else could enjoy the fundamental safety of not sharing data.