3 ms·
Yes! I spent some time a few weeks ago redoing some code that relied heavily on reflection into code that is fully statically typed and this only works because
by dangoor 4y ago
Yes! I spent some time a few weeks ago redoing some code that relied heavily on reflection into code that is fully statically typed and this only works because of generics. The particulars is that I have a YAML file that defines some validation information for incoming data and the old code used to dynamically compare the expectations from the YAML file with the data. The new code statically defines everything that's allowed in the YAML file and turns that into a small number of function calls to validate the incoming data.
It's a very frameworky piece of code, which is exactly the kind of thing that can benefit from generics.