When writing a library/API for the first time I'll usually start by sketching some ideas on a white-board or loose-leaf while thinking about how different parts of the system interact. This usually results in an interface that I'll adhere to when I go to develop some concrete implementation.
I'll get half-way through writing the implementation when I realize that I need to make a change to the interface. For example, I realize that I've exposed too much implementation detail to the client and that the interface can be simplified.
Is this bad-practice, and should I actually know exactly what my interface will look like before I start coding any implementation?
Update
In my situation I'm assuming that the interface doesn't already exist and we're creating it for the first time. So it's the first time that the interface will exist, and we are working on the very first implementation of that interface. So I want to know if in my situation, it's okay to make changes to an interface while coding the implementation.