Writing prose is actually quite similar to writing code. I don't think any author writes in linear, unidirectional process. Just like coding, you solve some subproblems (chapters, sections, etc.) before moving on to somewhere else, you go back and refactor so that the text flows better, or the ordering of points is better. And there are bugs. Stuff that's wrong, a dropped word and so on.
My experience with writing is mainly with academic prose, but I think most literary authors work like this as well. Besides, I do think that different programmers will have different styles in the same way different authors have styles. In part it'll probably influence your choice of language, but there'll be variation within a single language as well.
> I don't think any author writes in linear, unidirectional process.
Yes, people do. On the extreme end you have the stream-of-consciousness style. E.g., on the road was written on a typewriter with a series of sheets of paper joined together to avoid interruptions. I also think I remember Neal Stephenson saying in a talk that the writing should come out naturally, not sculpted word for word. When it doesn't, it's called writer's block; a programmer's block on the other hand is not really a thing.
Text is typically read linearly, so it's also easier to write that way. Code, except for the very simplest, jumps around from function to function so it's going to require some additional planning.
My experience with writing is mainly with academic prose, but I think most literary authors work like this as well. Besides, I do think that different programmers will have different styles in the same way different authors have styles. In part it'll probably influence your choice of language, but there'll be variation within a single language as well.