3 ms·
C# offers a way to mitigate that, somewhat. I often have something like this among the top level `using` statements. using FooMemo = System.Collections.Im
by noblethrasher 8y ago
C# offers a way to mitigate that, somewhat.
I often have something like this among the top level `using` statements.
using FooMemo = System.Collections.Immutable.ImmutableSortedDictionary<string, Foo>;
- alok99 8y agoYou can do similar in C++. The problem is when the number of long types and variable names grows, you end up with classes and functions full of `using`, which gets confusing fast.
- WorldMaker 8y agoAlso `var` is such an important mitigatory for this in C# that it continues to astound me that some of the worst offenders also eschew `var` in C#. You really don't need the redundancy of `ImmutableSortedDictionary<string, Foo> localCache = new ImmutableSortedDictionary<string, Foo>()`, it's not some sort of Prolog assertion where the strict tautology makes different code than `var localCache = new ImmutableSortedDictionary<string, Foo>()`.
- kstenerud 8y agoThe problems start when you open code to see var localcache = cachemaster.cacheFor(foo); Now you have no idea what it is until you dig into the (hopefully correct) API docs, or use an IDE that can untangle things.
- guitarbill 8y agoI don't buy it. It's one jump to method definition away, which even an editor without IDE capability should be able to manage. But also, this is what dynamic languages look like, and people still manage to be productive. (I'll agree it can be a bit tricky with LINQ and anonymous types in C#, but I think `var` usage is worth that trade-off)
- shermanyo 8y ago^ Your line of code is 85 characters though.. Would you bother to split this line somewhere? (if trying to conform to an 80char limit)