|
|
|
|
|
by jschwartzi
2688 days ago
|
|
I don't really use auto unless I'm interfacing with some templatized nightmare body of code where the typename is very difficult for my tiny human brain to interpret. Using "auto" is usually a code smell, because it means your type system is too complex for you to reason about. |
|
var foo = {bar = 1, baz = “Hello”, boo = “World”};
You get auto complete help and compile time type checking.
foo.bar = “Goodbye”;
Won’t compile. What would it buy you to not use ‘var’ and create a one time use class/struct?