What are the pros and cons of coding against a class vs coding against an interface? e.g. why would you decide to write:
IFoo foo = new Foo();
vs
Foo foo = new Foo();
Ive heard of trends e.g. I always code against the interface etc, just dont get why you would do one thing vs another, surely theres a reason why you do something, not just follow a trend for the sake of it.
IFoo foo = new Foo();
vs
Foo foo = new Foo();
Ive heard of trends e.g. I always code against the interface etc, just dont get why you would do one thing vs another, surely theres a reason why you do something, not just follow a trend for the sake of it.