OTOH, I find that writing some prototype code is one of the best ways to understand the problem and solution before starting to write the real program.
If you’re worried about lacking the discipline to throw away the prototype, do it in another language.