I have never been called a massive wanker, but I do often get confused stares when I try to explain this. For me both literature, or creative writing, to be less presumptuous, and programming are ways of expressing the ideas, stories and models that float around in my mind when I am thinking about the world. Some stories are better told with fiction, others by software. Many can be told by both, in the same way that a painter can paint the same picture with different techniques and get results that highlight different aspects of the picture.
As with all forms of expression, it is never possible to completely transfer the inner world of my brain to that of someone else. So we use approximations. Programming and creative writing are different techniques for making those approximations and both use text as a storage format. And thus they are naturally closely related to each other.
I would expect everyone I work with to believe this or at least appreciate the idea (or, maybe, I too am a massive wanker, and everyone in this field is a massive wanker after all).
Programming is at an intersection of mathematics (both higher and lower) and prose.
Lots of programming (especially as taught in school) is about the relationship between the programmer and the machine. How do I get the computer to do the thing I want? What are techniques to get desired behavior out of the computer?
I think a key difference between software engineering as a profession and programming as a craft (e.g. as it’s taught in schools) is that an enormous part of software engineering is about preserving the intent of your code. Without preserving intent (“the program does X with the intent of accomplishing goal Y”), coordinating changes to a program done by multiple people over a long period of time becomes very difficult. This is because it becomes hard to tell which parts of the program are meant to work the way they do vs. just incidentally working the way they do. Is this weird if-statement with a specific condition a temporary hack, or is it a deliberate code path that handles some known edge case? Without knowing this, it’s much harder to determine whether deleting this if-statement cleans up some now-irrelevant code or will cause a spooky breakage elsewhere in the system.
Preserving intent comes in lots of ways. Sometimes it’s using code idioms, sometimes it’s comments, sometimes it’s design docs. But it generally needs to be a deliberate goal of the writer. Many heuristics for writing code such as DRY or SOLID are at their core about preservation of programmer intent.
Peter Naur has a great article on this called Programming as Theory Building, where he calls this “preserving the theory” (or “preserving the program”).
I have never been called a massive wanker, but I do often get confused stares when I try to explain this. For me both literature, or creative writing, to be less presumptuous, and programming are ways of expressing the ideas, stories and models that float around in my mind when I am thinking about the world. Some stories are better told with fiction, others by software. Many can be told by both, in the same way that a painter can paint the same picture with different techniques and get results that highlight different aspects of the picture.
As with all forms of expression, it is never possible to completely transfer the inner world of my brain to that of someone else. So we use approximations. Programming and creative writing are different techniques for making those approximations and both use text as a storage format. And thus they are naturally closely related to each other.
You’re not a massive wanker.
I would expect everyone I work with to believe this or at least appreciate the idea (or, maybe, I too am a massive wanker, and everyone in this field is a massive wanker after all).
Programming is at an intersection of mathematics (both higher and lower) and prose.
I strongly agree with this perspective.
Lots of programming (especially as taught in school) is about the relationship between the programmer and the machine. How do I get the computer to do the thing I want? What are techniques to get desired behavior out of the computer?
I think a key difference between software engineering as a profession and programming as a craft (e.g. as it’s taught in schools) is that an enormous part of software engineering is about preserving the intent of your code. Without preserving intent (“the program does X with the intent of accomplishing goal Y”), coordinating changes to a program done by multiple people over a long period of time becomes very difficult. This is because it becomes hard to tell which parts of the program are meant to work the way they do vs. just incidentally working the way they do. Is this weird if-statement with a specific condition a temporary hack, or is it a deliberate code path that handles some known edge case? Without knowing this, it’s much harder to determine whether deleting this if-statement cleans up some now-irrelevant code or will cause a spooky breakage elsewhere in the system.
Preserving intent comes in lots of ways. Sometimes it’s using code idioms, sometimes it’s comments, sometimes it’s design docs. But it generally needs to be a deliberate goal of the writer. Many heuristics for writing code such as DRY or SOLID are at their core about preservation of programmer intent.
Peter Naur has a great article on this called Programming as Theory Building, where he calls this “preserving the theory” (or “preserving the program”).
Bold marks mine.
A skilled programmer is a skilled linguist. Period.