Towel
Towel copied to clipboard
[Examples] include examples for both clean and performance patterns
Much of the code in Towel is written two support patterns for both cleanest and most performant code. There needs to be two sets of examples demonstrating both patterns.
For example...
// Clean Pattern IMap<string, int> map = MapHashLinked.New<string, int>();// Performance Pattern struct IntHash : IFunc<int, int> { public int Do(int a) => a; } struct IntEquate : IFunc<int, int, bool> { public bool Do(int a, int b) => a == b; } var map = new MapHashLinked<string, int, IntEquate, IntHash>();
I'm trying to decide the best approach for implementing this issue. I'm currently considering the following:
- separate projects like
Examples\DataStructuresCleanandExamples\DataStructuresPerformance - implement both version in the current projects but have a
#if Clean/Performancecompiler directive - just include inline comments that show the two different patterns
I'm leaning towards option 2, but I'm open to opinions.