Comment

Comment by kryptiskt

It's an absolute massive codebase, but the compilers and analyzers in Roslyn[0] are very clearly written.

For a random example, here is the analyzer finding variable swaps of the form

     tmp = a;
     a = b;
     b = tmp;
that can better be done using tuples: https://github.com/dotnet/roslyn/blob/main/src/Analyzers/CSh...

And here is the code fix that automatically performs the substitution: https://github.com/dotnet/roslyn/blob/main/src/Analyzers/CSh...

[0]: https://github.com/dotnet/roslyn

parent kryptiskt 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton