What does a coder's ZK look like?
TL;DR - How do you implement your coding schema into your zettelkasten? Do you store code snippets in your Zk and how? There are reasons for and against including coding as a schema in a zettelkasten. There are different ways to treat coding in a zettelkasten.
In this forum post Code snippets in ZK, a few brave coders showed how they store snippet, UNIX commands, logging, concepts, and how-tos.
a pleasant side effect that many of my code snippets are now actually executable: I can spawn a repl for playing with the code on the zettel with a keypress.
I wonder how I might duplicate this? Keyboard Maestro to the rescue!
I'm usually asking two kinds of questions:
- What is this thing?
- What did I do about it last time?
@brennen goes on to differentiate between "a subject-matter dimension and a temporal dimension."
For me it's possible to divide the Zettels into three different groupings:
- abstract concepts - ideas, definitions, patterns, etc.
- concrete implementations - APIs, documentation of functions and keywords, classes, etc.
- HowTo's, concrete solutions and approaches
@matti's breakdown is sensible and would help focus finding answers to the pressing questions. This tactic of thinking about where the note fits when creating it will help it appropriately resurface.
@matti's blog post How I use my Zettelkasten as a developer is a wellspring of thought. He points out that time is precious and when you are on the clock, you have to be quick. He describes three ways he searches his coding questions. I'm not sure I get his references to note length and composabilty. His post responds to the forum thread and is well worth a look even if you are not a coder.
@henrikenggaard in How I use my Zettelkasten as a developer compares what I'd call a philosophical zettel with a coding zettel. He says, "For writing it is a really big advantage that vagueness and looseness is allowed -- a draft can be a draft build still have value because language is quite permissive. Code is of course much, much stricter."
@ctieze in My life as a craftsperson talked about producing "quite a few "tutorials to myself" in my Zettelkasten." He talked about his struggle to "keep my Zettelkasten clean; it was supposed to focus on truly important topics, like morality, living the good life, psychology, and stuff like that." Only realizing that programming is an essential topic for him and is part of living a good life.
Here is a list of prompts I'm trying out as I capture coding stuff into my ZK. Do you have other candidates?
- How have I implemented something similar in the past?
- What is the concept behind a function or class?
- How is the language syntax formulated?
- How do I do "X"?
- How is the code used?
- How will it be searched?
- When will it be searched for?
- What question does the note answer?
I must keep doing my best even though I'm a failure. My peak cognition is behind me. One day soon I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.