top | item 36029670

(no title)

elinnnn | 2 years ago

Yeah, I've never understood how people can find dynamic typing "simple and easy to use", types are wonderful for catching errors and documenting the code and makes refactoring much easier - I even avoid auto/var/type interference as much as possible because I like seeing what types things are.

discuss

order

tyingq|2 years ago

Consider that for many, things like Perl and Python were alternatives to using C, where the type system didn't always do a lot to help you.

galangalalgol|2 years ago

Rather than avoid type inference in c++ by removing auto, I typically specify a type on the RHS in C++. I mostly do this because it isn't that unusual for the inferred type to be something I don't want, but still kind of works. Eigen's matrix evaluator types as an example.

I haven't bumped into this with rust, but I don't see any reason it couldn't be the case, it may just be luck or the culture. I don't specify types in rust unless cargo check tells me to, and vscode with rust analyzer happily annotates all the types if I want it to.