|
|
|
|
|
by ragnese
2126 days ago
|
|
> Way before TDD was a thing, when I worked at IBM, we used to call this "inverted design": write the calling code first to see what the API might look like and then make it work. I really like the idea of this, and I very occasionally have the foresight and wherewithal to do this kind of "top-down" programming. Maybe not surprisingly, this is how I sometimes end up with the much-criticized "Interface with only one implementer" design smell. I write the interfaces that I would like, right next to where I'm writing the calling code. The interface(s) evolve as the calling code is unfolding. Then, later, I make an impl for the Interface. At that point I could just delete the interface and only use the concrete implementation, but... I don't. shrug. |
|