This is the 2nd Habit of the 7 Habits of Highly Effective People.
I have learned that it is also a habit of highly effective developers. Before starting work it is best to get a very clear picture of what done looks like. This is done by gathering requirements and ideally getting it in writing before starting development.
The results of this is avoiding doing unnecessary work, incorrect work, or work that should not be done at all.