Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Examples] include examples for both clean and performance patterns #81

Open
ZacharyPatten opened this issue Jun 7, 2021 · 1 comment
Labels
Enhancement issues that suggest potential improvements

Comments

@ZacharyPatten
Copy link
Owner

ZacharyPatten commented Jun 7, 2021

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>();
@ZacharyPatten ZacharyPatten added Enhancement issues that suggest potential improvements Good First Issue issues that are approachable even to first time contributors labels Jun 7, 2021
@ZacharyPatten
Copy link
Owner Author

I'm trying to decide the best approach for implementing this issue. I'm currently considering the following:

  1. separate projects like Examples\DataStructuresClean and Examples\DataStructuresPerformance
  2. implement both version in the current projects but have a #if Clean/Performance compiler directive
  3. just include inline comments that show the two different patterns

I'm leaning towards option 2, but I'm open to opinions.

@ZacharyPatten ZacharyPatten removed the Good First Issue issues that are approachable even to first time contributors label Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement issues that suggest potential improvements
Projects
None yet
Development

No branches or pull requests

1 participant