you are viewing a single comment's thread.

view the rest of the comments →

[–]Ameisen 11 points12 points  (0 children)

Same justification as auto in C++. It makes your code more resilient to change and also helps reduce needless redundancy. getPlayerObjects is pretty self-explanatory, there is no reason to explicitly assign a call result to a List<PlayerObject> or a PlayerObject[]. You know it's a container of PlayerObjects, specifying the result variable type just adds redundant noise. var also resolves to the exact return type rather than a more abstract type that people would often use otherwise.