4 ms·
‘auto’ (in C++) and ‘var’ (in C# and Java) is a blessing, makes code much less verbose. Also good for refactoring - less code to change.
by Koshkin 2y ago
‘auto’ (in C++) and ‘var’ (in C# and Java) is a blessing, makes code much less verbose. Also good for refactoring - less code to change.
- BalinKing 2y agoI’m only a C++ amateur, but IMHO C++ vs C#/Java isn’t really a fair comparison here—the latter doesn’t have template shenanigans and so types are much more transparent to the reader (by which I mean that you don’t have to execute a dynamically-typed program in your head to get from the term on the right-hand side to the type on the left).
- bigstrat2003 2y agoVerbosity is not bad. When it makes the code clearer, it is even a good thing.
- ithkuil 2y agoComplex type parameters make explicit typing highly impractical to be used all the times I like rust's approach in that it allows a mixture of explicit types and type inference using placeholders For example: "let x : Result<Foo<int, _>, _> = make_foo();"