🇬🇧
Cargo CultGetting it Wrong by Wanting it Right
📆
2018-10-05
Accepting interfaces instead of requiring specific implementations is a good practice. Take Java collections as an example. A method accepting an ArrayList argument will only be useful if the caller is already using an ArrayList. Otherwise he’d need to convert the implementation he’s using, say, LinkedList, to an ArrayList first. A method accepting …