Writing code when you know you dont have a solution is a complete waste of time. You end up with bad code you have to throw away. Or worse, you dont throw it away and end up with huge tail end costs of user errors, QA time, futile attempts to fix the rotten, and eventually rewriting the whole thing anyway.
Writing is apparently different in this regard.