2 ms·
I agree it's redundant if the type name occurs twice in the same statement. However, further evolution of the code often causes the instantiation to be moved el
by layer8 5y ago
I agree it's redundant if the type name occurs twice in the same statement. However, further evolution of the code often causes the instantiation to be moved elsewhere, and I wouldn't have confidence that the one doing that change then also changes `var` back to the type name. Instead, it would be nice to have syntax avoiding the duplication in the fashion of `FooBarBazThingyWithALongName thingy = new(...constructor parameters...);`.
- Serow225 5y agoC# 9 now has "target-typed new expressions" https://www.thomasclaudiushuber.com/2020/09/08/c-9-0-target-typed-new-expressions/ https://www.thomasclaudiushuber.com/2020/09/08/c-9-0-target-...
- lamontcg 5y agoIdeally linting tools on PRs show the refactored code as a violation, and it should be easy to rip a cleanup refactoring across the files before submitting a PR to avoid that.