3 ms·
Have you ever heard about the new thing called static typing programming language? I heard it force people to put only data with correct type into a function, i
by unrealhoang 8y ago
Have you ever heard about the new thing called static typing programming language? I heard it force people to put only data with correct type into a function, it doesn't allow me to put any memory address I want to, such bad thing. Ew.
Jokes aside, I see rust borrow checker is just another dimension of type checking, it is type checking for access behavior and that's all about it.
Just as you can wrap your data in memory into static type system and leverage it to make a class of mistake impossible (passing wrong data to a function), you can wrap your access behavior into lifetime type system (converting raw pointer access behavior to reference with correct lifetime/access using unsafe) and make a class of mistake impossible.
In my definition, that's a powerful tools that help me to write better code faster.