3 ms·
>And I noted that the more experience in software design a person has, the easier it is for them to truly internalize the borrow checker. I feel like this verg
by theon144 5y ago
>And I noted that the more experience in software design a person has, the easier it is for them to truly internalize the borrow checker.
I feel like this verges dangerously close to patting ourselves on the back, but...
>I suspect this is because you naturally get to an instinctive form of ownership model similar to Rust.
I do feel this is more or less correct. I've only had a literal handful of "battles" with the borrow checker (over a couple months spent with Rust); the rest seemed to naturally parallel the ownership semantics I wanted in my code anyway. Ownership meaning everything from "where does a value arise" to "what parts of the code have access to that value in the first place". It forced - or rather nudged - me to think about my architecture in a way that led to a rather clear design, although it might have taken longer than in another language. In another words, I did move slower, but refactoring is much easier and less frequently needed, and that's a tradeoff I'm all for.
- brabel 5y ago> refactoring is much easier and less frequently needed Compared to what? I have written about 10,000 lines of Rust so far... unfortunately, I stopped recently because I had a few huge refactors I had to make on one of my favourite projects which almost cost my sanity. The reason is that, in Rust, when you want to change the lifetime of a certain struct for example, you need to make sure that everywhere that's used it's only used in the new right lifetime... that turned out to be incredibly difficult to do and required heavy re-writing of many usages I had. Another huge refactor I had to struggle through was changing how I managed errors, and creating a new structure for my errors to be able to capture more information. Again, ran into huge issues which in a language with GC wouldn't exist. I still intend to go back to Rust as I do enjoy it even after all these issues I've had, but to claim Rust is easy to refactor strikes me as completely the opposite of the truth.
- axiosgunnar 5y agoYeah, I agree that error handling is not entirely on-par with the rest of the Rust developer-friendliness. I just use anyhow everywhere :D