3 ms·
I write both code and prose for a living. They are not even close to being the same. Can there be analogies, some very far fetched? Sure. Do those analogies
by mpweiher 3y ago
I write both code and prose for a living.
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.
- fbdrgvv 3y ago[dead]
- darkerside 3y ago> With a program, whether it compiles is a hard feedback. It either does or it does not, no wiggle room. So it's like writing javascript? Only half joking!
- boerseth 3y agoI 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.
- hnfong 3y ago> 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.
- rokob 3y agoCode 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.
- mpweiher 3y agoPrecisely. 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 https://www.jwz.org/doc/cadt.html :-)
- janderland 3y agoGrammar 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.