The language I use is C#.
Say that a method of an object returns a List<int>. If we assign this result to a variable of type IEnumerable<int> would we benefit anything or not?
In other words
IEnumerable<int> result = list
is better than
List<int> result = list,
where list is a List<int>.
I think intuitively that we will not benefit anything. However, i would like to be sure. Hence I am asking this.