Skip to content

Instantly share code, notes, and snippets.

@stevenheidel
Last active December 3, 2017 03:56
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 stevenheidel/065e5c8a6d6229f4f43c8fda0fc5519c to your computer and use it in GitHub Desktop.
Save stevenheidel/065e5c8a6d6229f4f43c8fda0fc5519c to your computer and use it in GitHub Desktop.
// AVOID:
CompletableFuture<T> method(CompletableFuture<S> param);
// PREFER:
T method(S param);
// AVOID:
List<T> method(List<S> param);
// PREFER:
T method(S param);
// AVOID:
T method(A param1, B param2, Optional<C> param3);
// PREFER:
T method(A param1, B param2, C param3);
T method(A param1, B param2);
// This method is clearly doing two things, it should be two methods
// The same is true for boolean parameters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment