A year ago, I suspended my programming career and started writing a novel thinking that my new activity was very different from the previous one. After many words written, but more often rewritten, I am almost certain of the opposite: programming large systems and writing novels have many similarities and similar processes.
The most obvious parallel between the two is that in both, you write something. Code is not prose written in natural language, but it has a set of fixed rules (grammar), certain forms that most programmers will find natural, and other forms, although formally correct, will seem difficult to understand.
However, there is a much deeper connection between the two activities: a good program and a good romance are the sum of well-functioning local and global elements. Good code should be composed of well-written and readable discrete elements, but in general, the different parts of the program should be orthogonal, consistent, and interact clearly with each other. A novel also has to be good at the same two levels - micro and macro. The sentences need to be well written, but the overall structure and the relationship between the parts are also critical.
The less structured relationship between programming and writing is the engine you need to get closer to one or the other: to be successful, you need to make progress, and to make progress, you need to be consistent. Everyone agrees that programs and novels are not yet written on their own. Twenty years of coding has helped me a lot in this aspect. I knew that everything moves only if you sit and write every day: today a hundred words, the next day two thousand, but there is rarely a day when I don't even write a word. And if you've written code that is not just "filler" for a larger system, but your own creation, you know that the writing crisis also occurs in programming. The only difference is that for most people you are an engineer, therefore, if you are not working,then you are lazy. The same laziness in the artist will take the form of a fun part of the creative process.
Differences.
I believe that the most obvious difference between writing and programming is that once written, edited, and refined, a novel remains largely unchanged. There are several cases of writers returning to their novels after a few years, publishing revised versions of them, but this is rare and often an isolated case. Code evolves over time, undergoing an endless stream of changes, often performed by several people. This simple fact has a profound effect on both processes: programmers often think that the first version of the system may be very imperfect, there will still be time to make improvements. On the other hand, writers know that they have one separate version for each novel, to the point that writing prose is basically a rewriting process. Rewriting sentences, entire chapters, dialogues,that sound out of tune. Rewriting sometimes two, three or even ten times.
I believe that programming in this regard can learn something from writing: when writing the first core of a new system, when the original creator is still alone, isolated, can do anything, it has to pretend that this first core is its only version. During the inception of the system, it will have to rewrite this primitive kernel over and over again to find the best possible design. My hypothesis is that this initial development will pretty much make it clear what happens later: organically growing something that has a good initial structure will lead to a better system, even after a few years from the initial creation, and even if the original core Was just a tiny fraction of the future mass that the system would eventually accept.
If you are interested, I will tell you briefly about my science fiction novel. After a lot of introspection, I sent the manuscript to my editor, Giulio Mozzi. He will send me suggestions for revisions in a few weeks. I'll start a new review process based on his notes and hopefully finalize the novel in a month or two. Then finally I will be ready to publish the Italian version. In the meantime, the revised novel will be sent to my translator in the United States, and when she has finished translating, the English version will be published. It's a long journey, but I loved it.