A story can't be 'wrong' as long as the grammar is used correctly. There (usually) are no hard requirements on the outcome or even the resource use of a story.
I'd rather compare programming to writing (classic) poems. Poems have a fixed structure, so the author needs to be economical and plan ahead with the syllables he uses and the story elements he introduces. While the outcome is still more or less open, we have to count in the artistic element (which is somewhat missing in programming), so this might introduce enough cognitive workload on the author to compare.