After a long while, I bought an (DRM-free) ebook again
(Manning currently has a 35% discount so go get it and maybe read it along with me? https://www.manning.com/books/the-programmers-brain)
The Programmer's Brain - Felienne Hermans

With this unique book learn how to optimize your brain’s natural cognitive processes to read code more easily, write code faster, and pick up new languages in much less time.

Manning Publications
Wait‼️ Why am I just now learning that @Felienne wrote a paper title “Programming is writing is programming”⁉️ That’s so obviously my jam! https://dl.acm.org/doi/10.1145/3079368.3079413
“Research has shown that when code contains comments, programmers will take more time to read it.”

‘Beacons are parts of a program that help a programmer understand what the code does. You can think of a beacon like a line of code, or even part of a line of code, that your eye falls on which makes you think, "Aha, now I see."

Beacons typically indicate that a piece of code contains certain data structures, algorithms, or approaches.’

Turns out that all that time I spend “making the code pretty” I was just making it understandable. The question is if what I consider pretty/understandable is the same as other programmers would call pretty/understandable

“after taking a course on design patterns, the time participants needed to maintain code was lower for the code with patterns but not for the code without patterns. The results of this study indicate that gaining knowledge about design patterns, which is likely going to improve your chunking ability, helps you process code faster. You can also see in the graphs that there is a difference in effect for different design patterns: the decrease in time is bigger for the observer pattern than for the decorator pattern.”

I have no idea what the decorator pattern is, but I’m a fan of the observer and i sprinkle it everywhere whenever I can.

A tangent: I think this the magic of functional programming: you have some well defined concepts that you can mix and match. It’s hard to learn them because they are unfamiliar, not because they are difficult, but once you do, it’s easier to reason about stuff that uses them

“In summary, you remember the longest if you study over a longer period. That doesn't mean you need to spend more time studying; it means you should study at more spaced-out intervals. […] This is, of course, in stark contrast with formal education, where we try to cram all the knowledge into one semester, or with bootcamps that seek to educate people in three months.”
“[…] recent research indicates that people never really forget memories—and that it’s the retrieval strength of memories that decays over the years”

In the age of so called AI isn’t it weird I’m reading a book that teaches you how to use refactoring and state tables for the sole purpose of understanding?

Weird is good though

The point of the chapter though is that readability and maintainability aren’t the same, and readability depends on the experience of who is reading.

So, for example, I tend to dislike loops now, I think they add too much noise to what usually can be just a map + a filter call, or reduce or whatever. But before I started to learn Haskell any code using higher order functions was overly confusing for me.

I been rejecting any attempt to make languages easier to learn or more familiar based on how my own experience. Learning is uncomfortable and takes time. There’s no shortcut. If you wanna help beginners don’t be an asshole when they ask stuff. That’s 100 better than adding braces to an ML language (yes I’m still mad at ReasonML)

I have to go, but what a cliffhanger: “Sajaniemi argues that with just 11 roles, you can describe almost all variables”

This books is making me doubly down on the idea that programming sucks because programmers suck, not because programming languages sucks. We approach the discipline in a way that’s nothing rigorous at all. We call 100% coverage rigor, and that’s laughable.

If you think and LLM can write code that’s as good or better than yours, that’s on you

“When reading entirely unfamiliar code, I find it helps to print out the code on paper or save it as a PDF that I can annotate. I realize it may feel weir to read code outside of the IDE, and you will tainly miss some features, like being able to search through the code. However, being able to write notes can deepen your thinking about the code, enabling you to interact with it on a different level.”
“The focal point of code is an important notion when reading code. Simply put, you have to know where to start reading. Some frameworks and techniques, like dependency injection frameworks, can fragment focal points so that they are far apart and hard to link together.”
“While most people Seibel interviewed said that reading code was important and that programmers should do it more, very few of them could name code that they had read recently. Donald Knuth was a notable exception.“
‘Have you ever asked a computer to do something, like "Please work this time?" Even though you know a computer is not a sentient being and cannot listen to you, you might still hold a mental model of a computer as an entity that can decide to act in your favor.’ This book has shown its age 😅
‘You might think that when you learn how something works in more depth, the old, "wrong" mental model is removed from your brain and replaced by a better one. However, in previous chapters we have seen that it is not likely that that information disappears completely from the LTM. […] So, especially in a situation of high cognitive load, you might suddenly use an old model.’
“[…] you should be careful about describing programming concepts and the corresponding workings of the computer in terms of objects and operations in the real world. While these metaphors can be valuable, they might also create confusion, especially since old mental models can remain in the long term memory and occasionally pop up in the working memory too.” Thank you‼️
“What you can assume people will know is not fixed in time and place, of course. When explaining a concept, it is therefore important to choose a comparison that the person you are explaining it to will be familiar with. For example, when explaining a computer's functionality to children in rural India, some educators have used elephants as computers and their trainers as the programmers since that is a principle familiar to the children.” 🤯