My favorite part of this post by Ian Miellis the introduction. The article is about shell commands, but the introduction brings up a more general point.
… there are thousands of reusable patterns I’ve picked up … Unfortunately, I’ve forgotten about 95% of them. … The point is to reflect on what actually stuck, so that others may save time by spending their time learning what is more likely to stick.
Why aren’t there more posts about techniques that stick? I see three reasons address in this article.
Bias against memorability
Techniques that make popular blog posts do not necessarily make useful long term memories. Novelty and brevity are more helpful than memorability if you want to make the top of Hacker News.
There’s a bias against memorability because it is a kind of negative property and hard to notice. You can notice that something is hard to remember more easily than you can notice that it is easy to remember. For example, Miellis quotes someone saying on Twitter that he can never remember how to use xargs
. It’s unlikely anyone will send out a tweet about how easy it is, say, to remember how to use the cd
command.
Fault finding
Another disincentive to writing about memorable techniques is inevitable criticism. Miellis is apparently well aware of this and preemptively addresses those who will gleefully find fault.
I’m acutely aware that for most of these tips there are better/faster/more elegant ways to achieve the same thing, but that’s not the point here.
Memorability is a fuzzy concept, and it’s easy to one-up a recommended approach on more objective criteria such as brevity or efficiency. “I can do the same task in two lest keystrokes. Take that!”
Subjectivity
Memorability is personal. As Miellis put it,
… your mileage may vary depending on your tastes and what you most commonly use the shell for.
Going back to the fault-finding angle, you almost guarantee contradiction if you say something is or is not memorable.
This doesn’t mean that memorability is hopeless. A writer can say in essence “Here’s what I find memorable. Try it. Maybe you’ll find it memorable too. If not, I hope you find something that works for you.” A reader can say “I actually find the solution you criticize easier to remember than the solution you propose, but I’m glad you brought it to my attention. Thanks.”
Ultimately you have to decide what works for you. One takeaway from Miellis’s article may be to think more consciously about what you’re likely to remember. Having to look things up is a major disruption to flow, and so a “better” solution may not be better in terms of overall productivity. A kludge you can cobble together without much thought is often more productive than an elegant solution that interrupts your work with research.
This is such a great point. I probably remember about 5% of the functionality of the tools I use. I am often plagued with the recurring thought that I know there’s a better way to accomplish my task, but I can’t remember it and it’s faster to type the inefficient thing than look up the better thing.
When it comes to the command line, I find that for me, memorability is tied to the early UNIX philosophy of doing one thing well. I can’t remember most of the arguments to ps, but I remember ‘aux’ because that prints all the things, and then I can pipe it to grep, cut, awk, etc. to make it useable. I probably use 5 binaries to do the work that ps could do by itself if I actually knew how to use all its features. I will almost always pipe a command to grep rather than using whatever search functionality is built into it. I will almost always use cat or echo rather than redirection operators, given the number of times I’ve accidentally created a file named grep or xargs or whatever instead of sending the file as input to that program.
It is what it is, and I think your discussion of the topic provides a very measured and helpful perspective in a setting where many people are in a hurry to tell each other how wrong they are for doing things the way they can remember how to do them.
Would this count as an argument for adopting code katas?
More info here: https://blog.codinghorror.com/the-ultimate-code-kata/
“Paul McCartney: The Beatles wrote memorable songs ‘because we had to remember them’” https://www.irishtimes.com/culture/tv-radio-web/paul-mccartney-the-beatles-wrote-memorable-songs-because-we-had-to-remember-them-1.4655903