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.
@discordian said:
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!
@brennen said:
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."
@matti said:
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.
Note-taking prompts.
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?
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. 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.
kestrelcreek.com
Howdy, Stranger!
Comments
@Will wrote:
I store a lot of snippets in my zettelkasten. I'm inclined to agree with @ctietze in that finding technical solutions to interesting and/or recurring problems is part of what makes for a satisfying day-to-day existence for me.
For me, there's nothing fancy - see attached. Code snippet and any explanatory notes, source if there is one. And maybe a word about the project where I used or encountered it first. I always make an attempt to link the new snippet note to some other note. Often that consists of adding it to a structure note. For example, for snippets that pertain to the Unix shell, I have a large structure note
20210411065601 §Shell snippets
that acts as a guide to hundreds of snippets below it. That note in-turn rolls up to20210207040647 §§Snippets
.And of course, I tag snippet notes to aid in finding things orthogonally across language categories.
Tangent: Sometimes I find myself wondering whether we get too judgemental with ourselves about what's in-scope vs out-of-scope for the ZK. There's a sort of implicit (or sometimes explicit) philosophical value that gets applied. "Oh that's not important/lofty/heady enough." As long as I'm conforming to the spirit of ZK - actively seeking and forming new connections within the content and not using it only as a collector's repository, I'm content with the strange juxtapositions between workaday snippet notes and musings on Nietzsche's Eternal Return.
Professionally I'm a collaborative pianist & chamber music coach,
Thanks for the thought-provoking and actionable reply.
Finding solutions to questions in the ZK, whether academic or technical, "makes for a satisfying day-to-day existence."
The little nugget you casually slip into the above paragraph leads to a gold mine of connectivity. I hadn't considered placing a few words about the project where a snippet is used. It sure would help with the search, and once landed on a candidate zettel/snippet, the example would be readily available via a potential link. I can imagine a query like
#snippets awk "Reference Weight"
being focused and quickly providing an example. I'm stealing this idea! I am all in for anything that adds links and/or references to my ZK.Questions
1. Is §§Snippets a 'root' note, or does it hang off some other note?
2. Snippets are one aspect of a coder's ZK. How do you handle software installation steps, links to tools like Cheat Sheets, UTF-16 tables, and other coding detritus that are not snippets?
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. 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.
kestrelcreek.com
@will:
I do have one level higher, which is a sort of "home" note. But
§§Snippets
is what I call a main structure note. That's as much formal hierarchy as I'm willing to enforce in my ZK.Well, similarly. But I always try to anchor it in something relevant to the goal I'm trying to achieve. It's my slight pushback against the tendency to just collect reference materials in my ZK.
Somewhat arbitrary on my part but I save a copy outside my ZK and only make a note about it if I'm actively using it; and then I'll only abstract the bits I'm using. Again, somewhat arbitrary boundary.
@will, you referred to the idea of contextualizing the snippet (and here, I'm talking all sorts of coding-related notes) - I suppose it's partly to help avoid stuffing unused references into my archive, but also to aid my feeble memory in finding its way back to something I learned at some point.
Favourite utterance while reviewing my archive: "Oh yeah, there's that..." ;-)
Professionally I'm a collaborative pianist & chamber music coach,
Thank you for your engagement in the conversation.
I completely identify with your phrase "Oh yeah, there's that… "
Breadcrumbs are what we are scattering in the hopes of "finding [our] way back to something [we] learned at some point."
I'm all in for not collecting frivolous stuff. Like you, I store stuff that 'feels' like a collection outside my ZK in Evernote and link back and forth.
Avoiding the Collectors Syndrome is a balancing act my mind is poorly calibrated for. We want to "avoid stuffing unused references into [our] archive" while at the same time we are poor judges of what will be useful and what won't. We add stuff to our archive with inspired intentions, and it quickly loses its usefulness. Pick your time frame if I trimmed everything unused from my ZK in the last year or two or ten or forty. I'd end up with a history of what I used and there'd be no potential left. We need some stuff that at one time had no use as the fodder for something new.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. 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.
kestrelcreek.com
At first glance, I read one of the sentences as "as long as I'm conforming to the spirits in the ZK" -- and I liked that. A co-worker almost a decade ago called a Zettelkasten a daimon that you feed. A genie in a bottle, a research humunculus, the ghost in the rock we call "computer processors."
This idea of feeding a spirit entity helps twist thinking a bit, in a good way, because then you can ask questions about the complex system that you are dealing with with it's inherent processes and logic. It's not "what does the [nonexistend!] ZK rulebook say about pasting code snippets/cooking recipes/...?", it's more like: "how does this fit in? Where could this seedling be planted into the garden?"
I do store snippets in my Zettelkasten, as you already pointed out. I don't have such a nice checklist to perform post-processing steps, though
Merely pasting code I wrote into a note doesn't cut it, so "How will it be searched?" is in the back of my mind all the time when I add things to the Zettelkasten.
I shared a breadcrumb-related story in 2019 where I added the search terms I find myself using time and again to the note so it would pop up, too. So this is a factor.
The introductory paragraph needs to say all the important things: where is this used, what alternatives did I consider, and is there context I should be remembering/loading into my own memory again when reading this?
E.g. here:
The introduction is actually 3 paragraphs, including the first code block; it's objective is to inform me about the supposedly canonical ways to do what I wanted to achieve:
In case I look for this topic, mouse cursor overrides, and all I have is this note with workarounds. In the future, I want to try again to do the right thing, not the hack that I discovered, even though I don't spend another hour now to process how the canonical implementation is intended to be.
Author at Zettelkasten.de • https://christiantietze.de/
I'm new here. Hi. I'm a zettelkasten enthusiast and a professional programmer, and mainly I just wanted to say it had never even occurred to me to put code snippets in my ZK. Probably because until very recently I used the old fashioned paper and pencil method. I'm not sure if I would start. I use my ZK for my interests outside of work. So far: mythology, note-taking, scaffolding, organic growth, quality, and psychology to name a few subjects in my own ZK.
Maybe you'll change your mind when you find yourself with Zettlr, and your IDE open all day, every day. There are so many advantages that my IDE (Visual Studio Code) has a zettelkasten plugin called Dendron so users don't even have to leave the IDE to create or search for a zettel.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. 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.
kestrelcreek.com