3 ms·
I can totally see how this kind of convenience might hinder learning. For me, the fact that “&a” does so much magic type conversion stuff had a similar effect.
by codeflo 5y ago
I can totally see how this kind of convenience might hinder learning. For me, the fact that “&a” does so much magic type conversion stuff had a similar effect. One thing I sometimes find helpful is to run an IDE (like VS Code with the Rust Analyzer plugin) and hover over every single variable to see its type.
Out of curiosity, since I expect to give a short Rust introduction in the near future, what was your language background when learning Rust? How familiar were you with C-style pointers and/or C++-style references?
- iudqnolq 5y agoA similar trick I learned from Jon Gjenset is to assert something has the unit type and read the error. let foo: () = complex_thingy();
- thomasahle 5y ago> Out of curiosity, since I expect to give a short Rust introduction in the near future, what was your language background when learning Rust? I have a background in lots of high level languages, like Python and Haskell, but never thought too much about how the types were represented. But prior to learning Rust I spent some time writing C (I've never done C++), so I guess I came in with a simple idea of how pointers work.