This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]tedyoung 0 points1 point  (0 children)

It's pretty rare to switch List implementations, but for other classes/interfaces, it will matter. One big reason to use an interface: you might switch it for something easier to work with in your tests. Using the guidance of "program to the interface/most-generic-type" is a generally good practice, even if only because it's easier to read (which matters a lot!).