This idea is taken from David Kahneman’s book, Thinking Fast and Slow.
The peak–end rule is a psychological heuristic in which people judge an experience largely based on how they felt at its peak (i.e., its most intense point) and at its end, rather than based on the total sum or average of every moment of the experience. The effect occurs regardless of whether the experience is pleasant or unpleasant. According to the heuristic, other information aside from that of the peak and end of the experience is not lost, but it is not used.
Some skills benefit from increased confidence (basketball), some don’t (programming). The former type can be prompted into a virtuous cycle where confidence increases performance, performance increases confidence, and so on. Awareness of the peak-end rule can be used to prompt this cycle.
For example, I’ve been working on my basketball shot, for which confidence is a necessary but not sufficient condition for success. At the end of every practice session, I’ll take half-court shots until I hit one, then immediately stop and leave. This spikes the “end” part of the peak-end rule. My retardo brain only retains a short-form memory of the practice session, in which the goodfeelz have been artificially inflated.
In general, confidence-spiraling skills can be inflated by ending practice sessions with repeated high-risk, high-reward behavior at the end, as long as there’s always a payoff on the last one. Otherwise, one experiences the other side of the two-edged sword- a bad run followed by a bad ending. This triggers a negative spiral of unconfidence -> nonperformance -> etc.
Negative endings are probably why many PUA neophytes fail, despite thousands of cold approaches. Their confidence was never increased by ending on a win. Whereas the PUAs who get laid (happy ending) go on to become men of supreme confidence, because confidence -> performance -> confidence -> etc.