The code will reveal the corner cases to you; you will think of things you didn't think of before writing the code.
Before you write the code, your ideas may be so poor that they don't even hit the happy cases when you try to code them. You go "Oh, what was I thinking; it's obvious now that it could never work that way ..."
Of course, it's coding we are talking about; there will be bugs. Fewer than in some wishful prose, though.