Physical Reasons Why Languages Fail – 6

Writer vs Editor

Program developers have to fill two roles: writer and editor. Unfortunately, developers cannot fill both roles simultaneously so they have to mentally time-slice between the two roles.

For example, experience (usually bad) teaches developers to switch back and forth between their inner-optimist that generates new code and their inner-pessimist that applies defensive code. The Writer (optimist) describes the basics of what needs to be done, but then we mentally shift to become the Editor (pessimist) that reviews the code for weaknesses and rewrites the code to make it more resilient to input errors or unexpected return values. From Pooh’s perspective in the 40 acre woods, we need to be either Tigger and Eor but we can’t be both of them at the same time so we have to switch back and forth.

The Writer is also responsible for inserting the punctuation needed in the program. The end-of-statement punctuation marks (; . , etc) aren’t too tough, but the punctuation that comes in pairs () {} [] “”, etc, have to be manually managed. This means that periodically we have to shift from Writer into Editor and start counting parentheses and/or curly braces and/or square braces.

IDE’s and smart editors try to help, but they aren’t smart enough to know what we intend a series of statements to do, so they can’t punctuate them correctly. Which means we again have to mentally switch back and forth between Writer and Editor to get the right number of closing curly braces at the end of our function. Because we can’t split our consciousness between Writer and Editor, we have to time-slice between them.

The Writer is also responsible for spelling everything correctly but we must mentally switch to the Editor to find any spelling errors. Again, IDE’s and smart editors help spot spelling errors, but they usually just highlight words that don’t match words previously spelled, interrupting the Writer and urging the Editor to mentally seize control of our single-threaded consciousness. We have to switch back and forth between Writer and Editor, time-slicing our attention.

Writer vs Debugger

Every developer must also perform the roles of Writer and of Debugger, but again we can’t do them both at the same time. As the program starts becoming runnable, the developer has to switch between Writer and Debugger, diagnosing errors and error conditions as the Debugger, and adding new code and fixing existing code as the Writer.

It would be incredibly more efficient and productive if these two roles could be filled simultaneously but it is unlikely that our single-threaded consciousness will ever be able to do them both at the same time.

For more on this . . .  Programming Languages Are Not Our Friends

Leave a Reply

Your email address will not be published. Required fields are marked *