News for hackers. Stuff that matters.
Re:Ladies, look at your code. Now back to mine. by StrawberryFrog on Sunday August 29, 2010 @02:43PM (#1644265)
Could you expand on what "program to an interface" means to you in this context, I'm not getting it. Assume that I know what it means in the usual context, of depending on the services of an interface type not a concrete type.
Re:Ladies, look at your code. Now back to mine. by henrikschroder on Sunday August 29, 2010 @03:59PM (#1644397)
With the var keyword the variable will be the exact same type as what you initialize it to, not an interface.

  List<Foo> list = new ArrayList<Foo>();
...is programming towards an interface, whereas

  var list = new ArrayList<Foo>();
...isn't, because the type of list will be ArrayList. I think his point was that with the new Java stuff you could instead do

  List<Foo> list = new ArrayList<>();
...which would then be explicitly programming towards an interface, while still not having to type so bleeding much.
Re:Ladies, look at your code. Now back to mine. by StrawberryFrog on Sunday September 05, 2010 @06:19AM (#1664304)
Programming to an interface just doesn't seem so useful within the scope of a method.