Hacker News new | past | comments | ask | show | jobs | submit login

I've noticed people coming from high level languages tend to struggle a bit with the borrow checker, did you guys experience this? How did you deal with it?



Yes, the borrow checker is undoubtedly one part of Rust that's unfamiliar, especially if your background is mostly in GCd langugaes where you can treat ownership and lifecycle concerns with impunity. So there is a learning curve which, when you get your code to pass all the compilation phases only for borrowchk to point out that your design is fundamentally unsound, can feel like a learning wall ;)

But at the end of the day the borrow checker is enforcing a relatively simple set of rules that you can learn and, with experience, intuit. So after a while the number of mistakes you make goes down, along with their severity. And there is payoff too in the ability to do things that would be impossible in Python and challenging in C e.g. write a copy-avoiding parser in performance critical code (not something too relevant to geckodriver, but useful for a so-far-prototype project to replace the log parsing on Mozilla's CI system — used to extract the reasons a job failed, and responsible for about 80% of the CPU time on that server — with a Rust alternative).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: