Hey there, developers!
So we already wrote about developer productivity, how to measure and increase it, and what to avoid while doing this.
But what to do when you are already productive and with a memory like a sieve?
Let's dive in and find out!
Terrible short-term memory?
Short-term memory, also known as primary or active memory, is the capacity to store a small amount of information in the mind for a short period of time.
If not rehearsed or maintained, these short periods of time last only 20 to 30 seconds, maybe even less. And we are limited to storing only seven items in our short-term memory, plus or minus two.
To retain information, it needs to be transferred from short-term to long-term memory. This includes several helpful techniques, such as:
- Maintenance rehearsal which includes repeating and going over something several times until information is stored in long-term memory
- Chunking includes organizing information into groups, numbers, words, phrases, and anything that helps with remembering
- Mnemonics are simple phrases, rhymes or abbreviations which make remembering easier
- These methods can be quite helpful to anyone, but some more developer-friendly methods exist.
What is literate programming?
In the programming paradigm known as "literate programming," created by Donald Knuth, a computer program's logic is explained in bits of traditional source code and natural language, such as English, from which compilable source code can be built.
"Literate programming: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do." - Donald Knuth (1984)
Some developers write the comments first and then start writing the code. This way, comments serve as a reminder and additional information for a part of the code or a detail you can always get back to.
Any language that supports comments can be used for literate programming as long as the comments dominate the structure of the code.
There is a case to be made for smaller components, such as libraries, even if writing large codebases in this manner would be extremely painful. For instance, you can benefit from literate programming if you're a web developer designing a React component.
For example, a form of literate programming can be seen in Jupyter notebooks. As in them, the language or narrative is more important. You can share concepts that incorporate code, data, and visualizations. And typically literate part goes first, which is then augmented by code.
What do you think?
Reposted to Blog