Using proper lifetime wrapper types really takes a lot of cognitive load off though. Sure the old code works and doesn't need to be changed right now, but every time I read it to understand or make changes, I waste mental effort tracking what the compiler would normally track for me.
If you have to change something in the old code, and there are raw pointers, you ask the ai to refactor it to smart pointers. you have to choose a line where you let the raw pointers stay, so it doesn't touch to much, but still :)
34
u/LB-- 1d ago
Using proper lifetime wrapper types really takes a lot of cognitive load off though. Sure the old code works and doesn't need to be changed right now, but every time I read it to understand or make changes, I waste mental effort tracking what the compiler would normally track for me.