Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simpleprogrammer-shared/6d2fc5e0e822ba994e080572cc3a9d15 to your computer and use it in GitHub Desktop.
Save simpleprogrammer-shared/6d2fc5e0e822ba994e080572cc3a9d15 to your computer and use it in GitHub Desktop.
3 Simple Techniques to Make APIs Easier to Use and Understand 5
public void LoginAsCustomer(LoginInfo loginInfo, CustomerType customerType = CustomerType.NEW_CUSTOMER, int numberOfTries = 3)
{
// ...
}
var loginInfo = new LoginInfo("Darth Vader", "ihatewookes");
LoginAsCustomer(loginInfo);
// What if we need to override a default? No problem.
LoginAsCustomer(loginInfo, customerType: CustomerType.REWARDS_CUSTOMER);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment