Skip to content

Instantly share code, notes, and snippets.

@bdkosher
Created May 9, 2020 01:02
Show Gist options
  • Save bdkosher/3ec6b02e51f2368fcee65c9bc51d3388 to your computer and use it in GitHub Desktop.
Save bdkosher/3ec6b02e51f2368fcee65c9bc51d3388 to your computer and use it in GitHub Desktop.
When concrete classes are preferrable to interfaces
String vs. CharSequence
- better relays immutability?
- so widespread that it can be an inconvenience to accept a CharSequence and have to do something with it, like pass to another 3rd party library method
Exception vs. Throwable
- error details object in REST application, don't want people to attempt to create these if there's an Error
LocalDate vs. ChronoLocalDate
"Most applications should declare method signatures, fields and variables as LocalDate, not this interface."
StringBuilder/Writeable vs. Appendable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment