Some people like math because problems have solutions. Most of the time, those solutions can be proved, and the right answer is unequivocally the right answer.
Math might be the only thing that works that way. Writing certainly doesn’t, and neither does programming.
Writing software requires a lot of math, creativity and logical thinking. Like writing books, writing programs have roughly two stages of revision (though in a different order).
The first thing you have to do with a program is get it to compile. Yes, there are interpretive languages like Java, but even those have to obey certain rules of syntax. In other words, your program has to not have any obvious flaws, a misspelled command, a missing semi-colon, etc. This is most akin to copy-editing which is usually one of the last things you do when writing.
Many young programmers make the mistake of thinking a program is finished and working if it compiles, just as many writers think a book is done after they first write it down.
But the next stage of checking a program is testing. My favorite way of saying this is to act like a drunken monkey is randomly hitting the keyboard. In other words, don’t assume that the user has any idea how to use the program properly. Can they still get the desired task done? You shouldn’t test program only in the ways it should be used, but in the countless other ways it could be used, even if those are wrong. Then you write additional code, or fix existing, to make sure the program can deal with all of those drunken monkeys.
This is what the writer does when they rearrange scenes, write bridging scenes, flip chapters, and put the story in front of beta-readers. You may have thought your narrative worked a certain way, but people reading it may show you otherwise, especially people who aren’t inclined toward your genre and its conventions.
But the last and most important stage of any story and any program is getting it out there.
It is impossible to code for every possible contingency, nor is it practical to do so. You could spend a month trying to solve a problem that might waste 5 minutes of 1 person’s time out of a million. That’s time that could be spent creating something else, or fixing the bigger flaws.
And you have to deal with the different ways people look at something. Anyone who’s tried to program cross-browser applications knows there is no perfect solution that looks exactly the same in all of the major web-browsers. We’re crazy enough people to get down to the pixel level and notice that Chrome adds a pixel where Internet Explorer doesn’t. And don’t even get me started about Firefox which insists on doing everything different.
Your readers will function much the same way. The way a scene will look in one person’s mind will play very differently in another’s. There may be ways they’ll look at a passage you would never have even considered. Sometimes this is wonderful and can teach you a lot about your own tendencies, and other times its annoying and you just want that person to shut up.
Whichever it is, you have to decide when a project is done, and what are the best things to fix before moving on to something else. Writing and software can be perpetual activities, but nothing would ever be finished if somebody didn’t throw up their hands and say, it’s done!