2 ms·
I have a bit of a different take on this. "Men say that a stitch in time saves nine, and so they take a thousand stitches today to save nine tomorrow." - Henry
by AnimalMuppet 3y ago
I have a bit of a different take on this.
"Men say that a stitch in time saves nine, and so they take a thousand stitches today to save nine tomorrow." - Henry David Thoreau, Walden.
It's good to not shoot yourself in the foot. Really. But, depending on what you're working on, it may not always be worth the effort to prevent.
For some things, of course it is. If you're working on something either safety-critical or enterprise-critical, you almost certainly want to use whatever tools you can to prevent shooting yourself in the foot.
But sometimes the price of the safety costs more than it's worth. At the extreme other end, if I'm writing an experimental one-off for my own curiosity, I'm not going to worry about satisfying the borrow checker (unless the point of the one-off is to learn Rust). If I'm writing an experimental one-off for work, that's likely to be still true - I'll write it in whatever gets me there fastest, because the point is learning what the results are, not producing production-level code.
Use the level of protection that's appropriate for what you're working on - no less, but also no more.
Note that all this is somewhat orthogonal to the question of whether one needs to shoot oneself in the foot before learning how not to. This is more like, once you've shot yourself in the foot, learn when to leave yourself exposed yourself to the possibility of shooting yourself in the foot again.