Let's say you have some issue to develop. And as recommended practice it is good idea to use interfaces ( I don't mean GUI, I mean interface or abstract class ). And you can apply two ( I'm pretty sure, but for now I noticed I apply two ) ways:
- Design interfaces upfront and then implement them.
- Implement classes and then on basics of classes discover interface.
Personally I prefer second option, but during discussions with other developers I noticed that somebody prefers first approach. I can say that I prefer second approach for the following reasons:
I can faster write code I avoid unnesessary code ( something that I never will use ) Interfaces in that case are more binded to "real" life For me it is more convenient. I'd like to hear other advices why somebody prefers option 1 or option 2. As usually I code in C#, but AFAIK java also have idea of interfaces
There is also third way:
- Design interfaces upfront, then write implementing classes, then finally discover all of your interfaces were wrong in the first place.