The Overall goal of writing code is to deliver to end user, so we can say it's a kind of release. So before making any changes or writing we use to have a discussion session where we debug to all possibilities. Then after i start creating SRT (Software Release Tracker) which contains below activity :
Why we write Design Document : This is the place where we get time to debug more about the function of the release, flow of the action, changes required in database, the required effort to write code. Having a design makes developer more comfortable to write code because he can focus on goal and will continue with same effort.
And also the documents help QA to cover more test cases and help them to think more about the corner cases so the planned deliverable will have a quality build.
Syed Fazle Rahman Sandeep Panda Pankaj Patel Lets debug the answer more by asking more questions.