As much as I fight with it, the borrow checker is really awesome


#1

This is probably more of a casual conversation topic than anything else.

I just finished fighting the borrow checker for a long time. It was really getting frustrating, especially near the end. I was so sure that I was right and that it was a non-lexical lifetimes issue. (That’s definitely the feature I find myself wishing for most these days.)

I finally stopped trying all my usual “get around the borrow checker tricks” and actually thought about what was going on. Of course, as pretty much always, the borrow checker was right. I was trying to use an immutable reference to an object while mutating it.

The borrow checker bested me once again! It might be frustrating to deal with at times, but it’s well worth avoiding the frustration my code could have caused had the checker not caught that mistake.

Thank goodness for that piece of software. Really grateful for this language’s existence. :slight_smile:


#2

Glad to hear that!

We prefer the term “fencing”, though :).


#3

I love that! Fencing is definitely more accurate. The borrow checker is a worthy adversary for sure. The kind you both despise and greatly appreciate. You despise it because you’re jealous of how awesome it is, but then really appreciate it’s grace and skill at the craft.

:smile: