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

@RosaCtrl I’ve come back around to for-loops & mutation as the most straightforward way to express most things (while also mapping well to how the underlying instruction set works)
@RosaCtrl you essentially can’t have arbitrary closures without a pretty complicated runtime/compilation framework if you want it to be somewhat performant

RE: https://social.vivaldi.net/@RosaCtrl/116266188163951271

@Profpatsch well, those are two different things, aren’t they? I’m talking as an user. In Swift I can’t use higher order functions when async is involved, so I have to use loops from time to time, and I still prefer pipping stuff to mixing intention and implementation in one place. I just love to see:
.map …
.filter …
.any …
These are beacons!

@RosaCtrl But now you need some sort of higher order lambda fusion framework if you want it to be performant at all
@Profpatsch I’ve replaced these with loops if necessary, yes. This makes me wonder if there’s any Swift feature regarding this that I’m not aware of…
@RosaCtrl fwiw I always write Haskell “as if the compiler is gonna be able to optimize it anyway”, and since I’ve never really needed it to perform better than e.g. a python runtime, I’ve always been fine :)
@RosaCtrl @Profpatsch I think LLVM can do a lot of this (and it’s partially why Apple invested so much into it).
@samir @RosaCtrl yeah, at the cost of huge compilation times
@Profpatsch @RosaCtrl Only if you’re not comparing to Haskell! 😛
@samir @RosaCtrl that’s true. but only because most people have 0 clue how to structure Haskell codebases for compile times …
@Profpatsch @RosaCtrl If you have to structure the codebase of a high-level almost-fourth-generation language for reasonable compile times, the promise has been broken.
@samir @RosaCtrl can’t undo logics unfortunately …
@Profpatsch @samir but who cares? Nowadays people is staring at screen that says “thinking” 😝
@RosaCtrl @samir It’s all about fast iteration cycles, and most compiled languages suck ass in that regard … Haskell is fine, because it has an interpreter with a fast reload
@Profpatsch @RosaCtrl Yeah, it’s actually good enough for running unit tests.
@RosaCtrl somebody’s reading The Programmer’s Brain
@RosaCtrl are you enjoying it?
@NicolasRinaudo you know already!
@RosaCtrl i mean i had some idea, which is why i recommended it (not taking credit for it, you already had it in your backlog), but i might have been wrong!
@NicolasRinaudo it’s my jam! But now I’m having stronger opinions and feel more spite towards stuff, like unreviewable code. It doesn’t have to be like that!
@RosaCtrl well get to evangelizing, girl :)

@NicolasRinaudo I don’t know, I’ll become more of a bitch!

Also I’m afraid of “let Claude review it for you” answers. I may punch someone in response!

@RosaCtrl that answer is equivalent to “don’t review it”, because presumably claude wrote it and the author didn’t review it themselves.

I would insist on that - either i’m required to review it, and then i review it, or i’m not, and we make reviews optional. The latter has a good chance to be picked, and then you can feel a warm glow of self satisfactions in a few months when issues are through the roof and no one understands how to fix them.