Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. final CsvMapper csvMapper, final boolean includeHeader, final boolean yankColumnRequired, final boolean includePreferredSiteToggle) {
  2.  
  3. Boolean parameters are a bad idea.
  4.  
  5. You could end up with functions like:
  6. public void someFunc(true, true, false, false, true)
  7.  
  8. where there's no context into what the parameter represents.
  9.  
  10. It would be better if these booleans could be wrapped in something like a csvOptions object, which has attributes like:
  11.  
  12. csvOptions.includeHeaders
  13. csvOptions.yankColumnRequired
  14. csvOptions.includePreferredSiteToggle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement