3 ms·
It is not that the borrow checker is zero value. But the borrow checker enters the game also depending on your code style. And when it does it gets quite viral
by germandiago 3y ago
It is not that the borrow checker is zero value.
But the borrow checker enters the game also depending on your code style. And when it does it gets quite viral with annotations and the like.
That is why I like more a model like the one found in Hylo language. It sidesteps the rigidity of the borrow checker and it can do very well.
Also, the code style I try to keep in C++ is quite "value-oriented" to avoid the typical lifetime pitfalls.
Nowadays I try to use STL with debug mode but not escape iterators. I am actually considering using a library like Flux because I think that, as fast as the iterator model is, it is basically playing with fire. Flux seems to be very competent performance-wise and safer, besides compatible with ranges.
I am quite happy with C++ at the moment. That does not mean I won't use Rust in the future. Who knows.
I hope more work towards safety will be fone in C++. I would not want a borrow checker, but avoiding as many pitfalls as possible is a good thing. I always use compilers with the maximum warning level and warnings as errors. It is actually a good thing to do.