[1] https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti...
[1] https://byorgey.wordpress.com/2009/01/12/abstraction-intuiti...
tldr: Pottery class, 2 groups. 1 group instructed to make the perfect pot (graded by quality of 1 best pot). 1 group instructed to make a bunch of pots (graded by pounds of clay used).
At the end of semester, the group who was trying to make as many pots as possible also produced the single best pot of the class.
Lesson: You need reps. Lots of reps. You really do just gotta do what comes naturally, get feedback, then do more. Doing is the only way to learn tacit skills.
You can read about the best way to ride a bike for 10 years and achieve nothing. Or you can spend an afternoon failing a lot until you can ride a bike. Software architecture and code structure are similar. You just gotta produce piles upon piles of code and see what works.
The story features Jerry Uelsmann and having his class of photographers either work by quantity or quality of shots.
The specific example I remember was "you can only take 1 shot" vs "take as many as you can"; and the lesson being /the group that did many reps had ultimately better photos/.
The post I linked predates Atomic Habits by 10 years :)
I have never seen so many kids harmed by bad pedagogy as “just do what comes naturally”. My daughter’s PE teacher gaslit her into thinking she was left handed with this advice and just created the belief that she was inept.
99% of what we do doesn’t come naturally, that’s why we are the most adaptable and successful megafauna in the history of the planet.
Learning is the essence of humanity.
Edit: you will be happy to know I fixed my daughters throwing technique with evidence based double blind tests to show her I knew what I was talking about and then taught her how to throw.
Take (again) dating advice: Saying something like "you shouldn't put so much emphasis on someone's looks" may help someone who is unsuccessful at dating and puts an inordinate emphasis on looks in their selection process. But if someone who already had a balanced view on looks that hears the advice, they may take it to heart and try dating people they have no physical attraction to and find less success.
Quote from a famous wizard.
Some theoretically-bent people can read a definition and generate their own examples, but most people I've met need to be presented with and taught one example at a time. After a while, they just get it and the abstraction falls into place.
The bigger insight, for me, is that they also have to be taught by counter-example.
E.g. it's easy to find Functors that are neither Applicatives nor Monads (usually, because you can't produce a reasonable definition for `return`). It's surprisingly hard to find a non-contrived example of a Functor that is also an Applicative, but *is not* a Monad. Without that counter-example, it's very tricky to build the intuition for where the boundary lies.
pure . Config
<$> validate option1
<*> validate option2
<*> validate option3
Either would short circuit on the first validation error. There’s two interesting things here though: there are no data dependencies between different validations (so we don’t _need_ a monad), and it’s useful to accumulate errors to know if both option1 and option3 failed to validate (so we don’t _want_ the Either monad’s short circuiting behaviour). The implementation is pretty straightforward, too!This is what mathematical training taught me to do. It's something I wish everyone could learn to do but high school is too short to teach it to most people.
1. One of the main points of functional programming is that your computations are the results of pure functions -- enabling niceties like thread-safety, type-safety, ....
2. That view of the world is imperfect because some interactions (like responding to user input) require a _sequencing_ of events.
3. Imperative languages accomplish that task easily. They just write the events in the sequence they want them executed. With constraint (1) though, your only option for sequencing is function composition. Whatever interface you choose, it _has_ to use composition somehow.
4. Monads are one of many possible solutions, and they're the one we happen to have standardized on. They're convenient because you can wrap up all that compositional nonsense into something that feels a lot like the mutable objects you're used to when you actually apply them in your code.
That explanation skips over a lot of details, but it helps people build the initial spark of intuition to attach all the rest of the ideas onto. The mechanics of a monad, their capabilities, the available syntax, ..., don't seem to be the main stumbling block in my experience.