hide arbitary detail of code in zettelkasten

Table of Contents

when using zettelkasten to write program, s like “getX”, “rotateX” will make your zettelkasten very dirty and unsensible(you look at the names of zettels and don’t know what it is about, which violates the essense of zettelkasten of the clearity of individual note)

A simple fix is to name the implementation of a feature sensibly, like “getting mouse position in HTML div with JS”, and use arbitary name only in the scope of inside the zettel, like the following

title: click and drag in JS

+ getX() <- ~[[getting mouse position in HTML div with JS]]~, and ~car~ the result ~(posX, posY)~
+ clicked <- ~[[handling clicking element in JS]]~
+ when mouse released <- ~[[guard on mouse events in JS]]~
+ move(distance) <- ~[[move div in its parent in JS]]~
+ states:
  + dragging -
   + action - move(deltaGetX())
   + transition - when mouse released -> notDragging
  + not dragging -
   + action - none
   + transition - when clicked the gallery -> dragging
+ start state: not dragging
...(actual implementation of the feature;insert this at useEffect, insert this at useEffect's return, etc.)...

Backlinks

zettelkasten as cheatsheet collection

look at examples of cheatsheet, there’s lot would make perfect zettels, or navigation zettels.

and with the effect, zettelkasten did give you access to all the knowledge at your finger tip(SPC n r f (org-roam-find-node)) without requiring you to remember them.

So zettelkasten is effectively a very large collections of cheatsheets(even the links can be seen as cheatsheet to terms used in another cheatsheet; refering to the example used in hide arbitary detail of code in zettelkasten, when using snippet zettels in another snippet-like zettel)

Author: Linfeng He

Created: 2024-04-03 Wed 23:14