Point 1 : you can remember to initialize values without auto, but you can't forget to initialize them with it. That's quite not the same.
OK, I have to admit: I almost never use auto v = short{3} 😆
Furthermore, tools like clang-tidy warn me when a variable isn't initialized.
Point 2 : if your code is so long that you can't even remember what is grid and why you are trying to iterate over it, then not using auto seems quite a poor way to improve the overall function ;)
I used to think the same as you are doing now, I (sort of) forced myself to use auto at the beginning, and now I find code more readable in a case like this one. Also, I made a parallel between auto in C++ and Python, where (somehow) everything is auto. It's just a different way of thinking from traditional C++ or C.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Point 1 : you can remember to initialize values without
auto
, but you can't forget to initialize them with it. That's quite not the same.OK, I have to admit: I almost never use
auto v = short{3}
😆Furthermore, tools like clang-tidy warn me when a variable isn't initialized.
Point 2 : if your code is so long that you can't even remember what is
grid
and why you are trying to iterate over it, then not usingauto
seems quite a poor way to improve the overall function ;)I used to think the same as you are doing now, I (sort of) forced myself to use
auto
at the beginning, and now I find code more readable in a case like this one. Also, I made a parallel betweenauto
in C++ and Python, where (somehow) everything isauto
. It's just a different way of thinking from traditional C++ or C.