I don't experience writing code as similar to writing prose. Code has a lot of technical constraints, and prose is much more about emotion.
I'm not saying they have nothing in common. Code and prose are both written in languages, and prose has certain technical requirements like good grammar, etc... There are very creative prose stories that play with the rules of language. But the primary focus of prose is it's effect on people and that has a different requirements than a program which has to run, run correctly, be understandable, and be maintained.
> I don't experience writing code as similar to writing prose. Code has a lot of technical constraints, and prose is much more about emotion.
Emotional constraints. You need to play those emotions in the right way to obtain desired outcome in the reader.
> There are very creative prose stories that play with the rules of language.
Just like demoscene, iocc or quines. Some stories/programs play with the rules of language/language to obtain desired awe inspiring result in reader/machine, some are more direct to obtain desired novel idea/calculation in reader/machine.
> But the primary focus of prose is it's effect on people and that has a different requirements than a program which has to run, run correctly, be understandable, and be maintained.
Not all programs need to be maintained, some are pretty good as is for their intended purpose. The rest is also a requirement for prose. It has to be read and understood for it to be usable.
Quote of the day:
"Debugging is like being the detective in a crime movie where you are also the murderer." - Filipe Fortes.
I think that you're saying that writing code is the same as writing prose. My experience is that, if I write both in the same way, I will fail at both. People just don't read prose to bask in it's technical correctness. Programming, at least the kind people get paid for, has strict technical requirements. They may get met in a creative manner, but they must be met. The primary output needs to be workable, runnable code. Programmers get paid to solve problems. But so do, e.g., surgeons. It doesn't mean that surgery is the same as programming, even if some people are called "code surgeons".
It's not the same, but there are some similarities. They have different purposes, so it's enough to say that they are not the same. I was just playing devil advocate and wanted to show that the set of arguments presented by original commenter was not that good.
The assertions are quite generic to the point you could apply them to most pursuits or hobbies.
I think there is definitely an interesting link between coding and creative writing, but to me it's the way it scratches the same itch of producing something out of nothing, of the planning and different approaches you can take. They are similarly rewarding to me.
In all other ways beyond the surface level of yes, both involve writing words, I think they're wildly different. My anecdotal evidence is I find it very difficult to swap between writing code and writing fiction on the same day - I am either doing one or the other, and I feel it's because of how differently the brain works in these 2 modes.
If anything, I think coding has stronger similarities to maths, and it's just interesting that many coders also do creative writing - which I'd attribute it mostly to an intersection of people who like science fiction and also like making things.
Not to mention that feeling of emptiness and irrecoverable loss when a beloved binding goes out of scope. The passing of this local function left me with the existential dread of utter oblivion!
Interesting. I explain it to non-tech people as like painting a landscape. There are many different ways to do so and I like to build up from low detail to higher detail until there is enough.
This to me makes as much as sense as comparing coding with running. I take a step, then I take another one, sometimes there are hurdles along the way, sometimes I get tired and I do it again the next day. And similar sense as the article.
I really struggle with writing. It’s when I try anyways, however, and push through that, when I see how the process behind the two is similar. In both you’re just structuring ideas to direct the flow of data to achieve some goal.
It makes me dream of a day where I can just sit for hours and get lost in some prose, and come out of that with an end-to-end working demo.
Coding and drawing are the only two activities where I can be like that for now. Writing would be so cool to add though.
Prose is the freest, loosest, and default way of writing in English.
Writing code is a lot more like writing verse in iambic pentameter [1]: You have technical constraints that you need your writing to conform to, and thoughts or sequences can stretch out over many distinct lines.
[1] - Lines of ten syllables with certain rules, usually applied loosely, for syllable emphasis.
> When writing prose, the reader’s brain becomes a compiler, translating the words from screen or paper into tangible thoughts and images, even if the words are not strictly correct.
This feels like someone felt that writing and coding are similar, and went on to force analogies between every aspect of both.
I really like this post. However, one of the reasons I love writing fiction so much is that it feels like such a _different_ way to express myself creatively than programming. Both use my brain, but in totally different ways, almost like exercising different muscles.
I think you can find similarities of the kind listed in this post within pretty much any two activities if you look for them. But overall the differences are what make writing and coding so well-suited and _fun_ to experience in one brain in my opinion.
In the end, both coding and writing are a way for me to vent my creativity and bring the worlds and ideas in my head into something tangible. That is their primary similarity. I do believe programming and writing fiction are two sides of the same coin. But they feel largely orthogonal to each other in my experience of them.
(After I wrote the last sentence I wasn't sure I was using the term "orthogonal" correctly, as I see that in the plain English sense of the term it seems to mean entirely independent... When what I am trying to express is rather that they _are_ related and _not_ entirely independent. As my experience or knowledge of coding changes, so does my experience of writing, in the sense that they retain the consistent right angle or relationship to each other despite otherwise feeling very different.)
There is not some evidence or argument in the article to actually support this claim. If anything, assuming the more plausible hypothesis that programming and mathematical thought are akin to each other, and the fact that research supports that there brain networks related to mathematical reasoning unrelated to other language activities [1], I would think it is much more plausible that writing code is fundamentally different from writing prose (even if they do share some similarities as language goes).
There is a close connection between mathematical thinking, including all between basic arithmetic up to calculus, algebra and advanced research mathematics, and specific spatial abilities and skills (specifically mental rotation/transformation, but not other spatial/navigation skills [2]). Programming is also imo a mode of mathematical thinking, and in this one needs to construct and manipulate logical relations between objects and processes. This makes it different than prose, where the relations are of different natures. I think this is what is missing from this: math and programming alike involve a certain understanding and manipulation of relations, which uses our preexisting toolbox of spatial reasoning (which may or may not take the form of explicit mental visualisation; people with aphantasia can also be good in mental rotation tasks).
Maybe because pronouns act as implicit identifiers? Kotlin goes a little way towards that by letting you use "it" to refer to the first parameter of a lambda (which are used extensively) without having to introduce a new noun.
This is probably different for different people. People experience creative activities in different ways.
Programming, maths and computer games all feel about the same for me. Painting, prose or music are not the same activity in any sense. Might be worth noting that I scored poorly on language testing and highly in mathematics during education as some external validation that they aren't the same thing for me.
The author has generalised their experience to that of all people, possibly for dramatic effect.
> The act of writing Code and writing Prose is the same. They both use the same mental processes, have language constructs and audiences
They don't use the same mental processes (do you code 3 characters per second for extended periods of time?), the language constructs are very different (just one example: no ambiguity), and your audience is not in a social relation to you. So no.
To some extent, that analogy is interesting. Some code bases are really written like beautiful prose. All the rails code base is like that. WebKit is another great example. You can actually pretty quickly figure out where the flexbox layout implementation is.
Postgres code base is also notable in that regard.
This article absolutely infuriates me. Total horse shit. Not even a remotely valid premise and the execution is pathetic. It is on par with Flat Earth and Phrenology texts.
absolutely agree!
But the difficult part is to find good arguments against it, which go beyond your feelings. Because we live in world, in which feelings alone have become almost meaningless.
The author at one point advocates speeding up the writing process by incorporating bogus nonsense from ChatGPT and chucking the whole thing over the wall to someone else for fact-checking after it's completed. They may have taken the same approach with this article.
I have definitely found the same joyous feeling of ‘flow’ when writing prose and when writing code - when you just write and it pours out of you uninterrupted, and at the end you come out of your fugue state and think “whoa, I wrote all of that?”
As both an author and software developer, I find writing fiction to be wholly different from writing code. There is almost nothing in common between the two for me. (I’m pretty sure about this because I know quite a lot about how my brain doesn’t work and how I compensate for broken hardware.)
Documentation has significant overlap with code at work… because I treat shared code as documentation. For personal projects, I don’t do this and writing code has no relation to writing prose.
> It’s a bit nonsensical to compare the number of words in English to the number of packages in PyPi, but we can agree that both English and Python are very rich languages, and no single person can reasonably understand the full scope of either language.
If I were editing this article, I would tell the author to remove the entire paragraph leading up to this snippet. Why would you insert a section that's so bs that even you immediately criticize your own point?
Truthfully, I read this article and came away with the conclusion that writing code is nothing at all like writing prose.
Can there be analogies, some very far fetched? Sure.
Do those analogies mean that the two are the same? No.
Is the reader's brain like a compiler? No. Compilers are very literal. Readers' brains build an imagined world from the hints given by the author.
One huge difference is the feedback. With a program, whether it compiles is a hard feedback. It either does or it does not, no wiggle room. Same if your unit tests pass. Does this sentence work? Maybe. Are you done revising that chapter? Well, I guess it's better now, but it still seems a bit wonky.
I agree that code is restricted by harder constraints, in that tests need to pass and typos/grammatical errors are disastrous.
But being able to write code that merely runs is the bare mimimum requirement you could put on a programmer. The thing is, the compiler is not your only audience.
>Readers' brains build an imagined world from the hints given by the author.
This is as true when reading code as when reading anything else.
> Is the reader's brain like a compiler? No. Compilers are very literal. Readers' brains build an imagined world from the hints given by the author.
Code is mainly to be read by a person. Otherwise there is no reason to keep a copy of the source file after it's been compiled into binary/executable form.
The main difference you pointed out is that for code to be functional it has an additional requirement of having to comply with rigid rules of the programming language, but the "reader" is still human.
Code is not mainly to be read by a person. It is a step to an executable artifact. It is read by a person mainly to modify that artifact. This trope that code is meant to be read is misunderstanding why you are reading it. One doesn’t read code as prose for its own sake. You read code as a means to an end. It is why we sometimes only read the documentation of libraries without reading the underlying code.
Grammar checks are somewhat like compilers. When I type prose or code into my text editor, both are underlined with squiggly lines if they are grammatically incorrect.
Furthermore, I compose both types of text in an iterative process where I got the general ideas down first and then improve the precision and completeness of the piece.
Lastly, I think deeply about the human meaning of the text before I consider it complete, at least for my side projects. I refactor the code so that it matches my human model of the problem as well as I can.
Your mileage my vary, but coding and prose feel similar in my experience.
That's why I hate this new breed of computer idiot who presumes to be equal in everything, in order to elevate themselves above the futility of their control structures. And also the reason why I'm actually completely wrong on this platform and will be considered an outsider.
No, computer programs (and code) neither solve existential problems nor do they resemble a poem or a story.
It may be that for a developer 'meaning and code' coincide and have a special "artistic" meaning, but that does not mean that the emergent result is of general importance or has anything artistic about it. Running a loop and checking conditions a thousand times per second may give you a certain feeling, or even "Microsoft Word", but in the end it's just repeating the same thing over and over again. The only artistic thing about machines and programs is their speed.
Actually, for speaking to a machine one has to think like a machine, and for writing a poem, one has to think like a human.
'Ah, so you feel proud to have programmed a new 'service' that no one needs?' Congratulations! Be happy that there is also art, to which you have now turned to in order to experience something different from what you claim to be the same.
Well, I suppose opening an essay with a compound gerund is close enough to the prose equivalent of premature optimization to suggest they may be onto something. However, aside from both processes optionally using keyboards for efficiency, code and prose really couldn’t be more different.
Writing code uses the multiple demand network of the brain while writing prose uses mainly the language centres of the brain. Writing code is very much not the same as writing prose.
Source: https://www.cs.cmu.edu/%7Eckaestne/pdf/icse14_fmri.pdf (paper is mostly about reading code, but there are a collection of papers that together with this, puts together a strong argument that it's the same for writitng)
54 comments
[ 3.3 ms ] story [ 95.5 ms ] threadI'm not saying they have nothing in common. Code and prose are both written in languages, and prose has certain technical requirements like good grammar, etc... There are very creative prose stories that play with the rules of language. But the primary focus of prose is it's effect on people and that has a different requirements than a program which has to run, run correctly, be understandable, and be maintained.
Emotional constraints. You need to play those emotions in the right way to obtain desired outcome in the reader.
> There are very creative prose stories that play with the rules of language.
Just like demoscene, iocc or quines. Some stories/programs play with the rules of language/language to obtain desired awe inspiring result in reader/machine, some are more direct to obtain desired novel idea/calculation in reader/machine.
> But the primary focus of prose is it's effect on people and that has a different requirements than a program which has to run, run correctly, be understandable, and be maintained.
Not all programs need to be maintained, some are pretty good as is for their intended purpose. The rest is also a requirement for prose. It has to be read and understood for it to be usable.
Quote of the day:
"Debugging is like being the detective in a crime movie where you are also the murderer." - Filipe Fortes.
The assertions are quite generic to the point you could apply them to most pursuits or hobbies.
I think there is definitely an interesting link between coding and creative writing, but to me it's the way it scratches the same itch of producing something out of nothing, of the planning and different approaches you can take. They are similarly rewarding to me. In all other ways beyond the surface level of yes, both involve writing words, I think they're wildly different. My anecdotal evidence is I find it very difficult to swap between writing code and writing fiction on the same day - I am either doing one or the other, and I feel it's because of how differently the brain works in these 2 modes. If anything, I think coding has stronger similarities to maths, and it's just interesting that many coders also do creative writing - which I'd attribute it mostly to an intersection of people who like science fiction and also like making things.
Don't you like your variables? Are you not heart-broken when you need to let some dead code go?
:-)
It makes me dream of a day where I can just sit for hours and get lost in some prose, and come out of that with an end-to-end working demo.
Coding and drawing are the only two activities where I can be like that for now. Writing would be so cool to add though.
Writing code is a lot more like writing verse in iambic pentameter [1]: You have technical constraints that you need your writing to conform to, and thoughts or sequences can stretch out over many distinct lines.
[1] - Lines of ten syllables with certain rules, usually applied loosely, for syllable emphasis.
This feels like someone felt that writing and coding are similar, and went on to force analogies between every aspect of both.
I think you can find similarities of the kind listed in this post within pretty much any two activities if you look for them. But overall the differences are what make writing and coding so well-suited and _fun_ to experience in one brain in my opinion.
In the end, both coding and writing are a way for me to vent my creativity and bring the worlds and ideas in my head into something tangible. That is their primary similarity. I do believe programming and writing fiction are two sides of the same coin. But they feel largely orthogonal to each other in my experience of them.
(After I wrote the last sentence I wasn't sure I was using the term "orthogonal" correctly, as I see that in the plain English sense of the term it seems to mean entirely independent... When what I am trying to express is rather that they _are_ related and _not_ entirely independent. As my experience or knowledge of coding changes, so does my experience of writing, in the sense that they retain the consistent right angle or relationship to each other despite otherwise feeling very different.)
There is not some evidence or argument in the article to actually support this claim. If anything, assuming the more plausible hypothesis that programming and mathematical thought are akin to each other, and the fact that research supports that there brain networks related to mathematical reasoning unrelated to other language activities [1], I would think it is much more plausible that writing code is fundamentally different from writing prose (even if they do share some similarities as language goes).
There is a close connection between mathematical thinking, including all between basic arithmetic up to calculus, algebra and advanced research mathematics, and specific spatial abilities and skills (specifically mental rotation/transformation, but not other spatial/navigation skills [2]). Programming is also imo a mode of mathematical thinking, and in this one needs to construct and manipulate logical relations between objects and processes. This makes it different than prose, where the relations are of different natures. I think this is what is missing from this: math and programming alike involve a certain understanding and manipulation of relations, which uses our preexisting toolbox of spatial reasoning (which may or may not take the form of explicit mental visualisation; people with aphantasia can also be good in mental rotation tasks).
[1] Origins of the brain networks for advanced mathematics in expert mathematicians https://www.pnas.org/doi/10.1073/pnas.1603205113
[2] Reimagining Mathematics: The Role of Mental Imagery in Explaining Mathematical Calculation Skills in Childhood https://onlinelibrary.wiley.com/doi/abs/10.1111/mbe.12281
Pieces written in a programming language are full of proper nouns (variables names) and proper verbs (function names).
Pieces written in English get pretty far without introducing new identifiers all the time.
There are natural languages without pronouns too, or at least it's seen as rude to use them like in Japanese.
Programming, maths and computer games all feel about the same for me. Painting, prose or music are not the same activity in any sense. Might be worth noting that I scored poorly on language testing and highly in mathematics during education as some external validation that they aren't the same thing for me.
The author has generalised their experience to that of all people, possibly for dramatic effect.
They don't use the same mental processes (do you code 3 characters per second for extended periods of time?), the language constructs are very different (just one example: no ambiguity), and your audience is not in a social relation to you. So no.
Postgres code base is also notable in that regard.
Read with caution because this is brain poison.
Live for those moments.
Documentation has significant overlap with code at work… because I treat shared code as documentation. For personal projects, I don’t do this and writing code has no relation to writing prose.
If I were editing this article, I would tell the author to remove the entire paragraph leading up to this snippet. Why would you insert a section that's so bs that even you immediately criticize your own point?
Truthfully, I read this article and came away with the conclusion that writing code is nothing at all like writing prose.
I do write both code and short stories, and honestly it feels like 2 completely different activities to me.
They are not even close to being the same.
Can there be analogies, some very far fetched? Sure.
Do those analogies mean that the two are the same? No.
Is the reader's brain like a compiler? No. Compilers are very literal. Readers' brains build an imagined world from the hints given by the author.
One huge difference is the feedback. With a program, whether it compiles is a hard feedback. It either does or it does not, no wiggle room. Same if your unit tests pass. Does this sentence work? Maybe. Are you done revising that chapter? Well, I guess it's better now, but it still seems a bit wonky.
etc.
So it's like writing javascript? Only half joking!
But being able to write code that merely runs is the bare mimimum requirement you could put on a programmer. The thing is, the compiler is not your only audience.
>Readers' brains build an imagined world from the hints given by the author.
This is as true when reading code as when reading anything else.
Code is mainly to be read by a person. Otherwise there is no reason to keep a copy of the source file after it's been compiled into binary/executable form.
The main difference you pointed out is that for code to be functional it has an additional requirement of having to comply with rigid rules of the programming language, but the "reader" is still human.
And studies showed that code is read by humans far less than assumed.
And, in my experience, understood even less. Instead, it is rewritten from scratch.
See also CADT development paradigm: Cascade of Attention Deficit Teenagers
https://www.jwz.org/doc/cadt.html
:-)
Furthermore, I compose both types of text in an iterative process where I got the general ideas down first and then improve the precision and completeness of the piece.
Lastly, I think deeply about the human meaning of the text before I consider it complete, at least for my side projects. I refactor the code so that it matches my human model of the problem as well as I can.
Your mileage my vary, but coding and prose feel similar in my experience.
No, computer programs (and code) neither solve existential problems nor do they resemble a poem or a story. It may be that for a developer 'meaning and code' coincide and have a special "artistic" meaning, but that does not mean that the emergent result is of general importance or has anything artistic about it. Running a loop and checking conditions a thousand times per second may give you a certain feeling, or even "Microsoft Word", but in the end it's just repeating the same thing over and over again. The only artistic thing about machines and programs is their speed.
Actually, for speaking to a machine one has to think like a machine, and for writing a poem, one has to think like a human.
'Ah, so you feel proud to have programmed a new 'service' that no one needs?' Congratulations! Be happy that there is also art, to which you have now turned to in order to experience something different from what you claim to be the same.
I get angry when I have to read such nonsense.
Source: https://www.cs.cmu.edu/%7Eckaestne/pdf/icse14_fmri.pdf (paper is mostly about reading code, but there are a collection of papers that together with this, puts together a strong argument that it's the same for writitng)