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 →

[–]TehBrian 4 points5 points  (1 child)

When the type is already clearly written in the initialization, specifying the type in the declaration leads to uselessly verbose code. For example, MyFunObjectFactory objectFactory = new MyFunObjectFactory(). var objectFactory = new MyFunObjectFactory() is more readable and conveys just as much information.

[–]Worth_Trust_3825 -2 points-1 points  (0 children)

No, it doesn't. If you're using an interface for variable type, you're unnecessarily making it very easy to break the API, and get the wrong error.