‘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 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)
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!
RE: https://social.vivaldi.net/@RosaCtrl/116239430204850754
@samir @Profpatsch appropriate response