Ask HN: As a programmer, How do you take notes while coding?

20 points | by abacussh 1 day ago

25 comments

  • pajko 1 day ago
    40+ unsaved tabs in Notepad++, mixed stuff, containing keywords about the things I'm working right now, 2-3 line descriptions about an idea or how to proceed with something in the future, copy-pasted and "annotated" fragments of logs or code under reverse engineering (would do most of this stuff by hand but have an awful handwriting). Plus a booklet to scribe quick ideas, play with an algorithm in my head, and draw stuff if that's unavoidable (code graph, state machine diagram).
    • Rendello 1 day ago
      If your computer power cycles it will be a mini Burning of Alexandria!
      • virtualmic 18 hours ago
        Not OP, but Notepad++ does restore open tabs. :-)
  • SenHeng 9 hours ago
    If it’s related to the task at hand, I create a comment block inside the ‘main’ file. Sometimes the comments are spread out so I make sure not to commit them to git which is easy because I’m a GUI using heretic. Sometimes I even have a single commit that contains all the comments with a simple DELETE ME commit message. I simply move the comments up to HEAD and append new comments to it where necessary.

    Otherwise I send myself a DM in slack.

    I actually use slack self-DM for all sorts of notes and TODOs. They’re available on multiple devices, they have an amazing preview functionality for files and urls, they accept markdown to a degree, they’re still around when the power goes out, etc.

    For something more long term like a journal, I use Bear.app.

  • graypegg 12 hours ago
    I really like big deskpads. The bigger the better. Having a big calendar/grid paper sheet right under your keyboard makes it so much more likely for me to pre-plan things because I can sketch faster than I can type.

    Here's an idea for someone: have some easy-to-rattle off key combo you can push to record the current state of whatever application is currently focused on screen (what project/files are open in my IDE, what tab is focused in my browser, etc) to a little sqlite instance somewhere. Show a notification with an easy to write down unambiguous ID that auto increments, probably including the date. Like 14APRB or something.

    I can jot that down in my notepad. Later on, I can bring that workspace back up using the ID I wrote down, so that way I'm not writing file paths and method names down on paper.

  • wruza 1 day ago
    Pen and paper. I put a mm-high paper stack into a transparent file and take one sheet out and put it on top. This way it's comfy to write on (soft surface) and it leaves a nice afterimage on a file after a while, which is visible at an angle in daylight. Very cozy and professional, plus doesn't collect dust. I also put a sheet back under if it has any value, so I can address it later. But usually I strike out points, rewrite what's left on a new sheet and bin the old one. I tend to use thin-ish gel pens cause you can add details in fine strokes if needed. For space management I'm using an arm mount for the display, so that the keyboard can go all the way under it, leaving space for the paper. I also tend to work at long tables, at least outstretched arms long, so it has enough space for everything including "amenities", because otherwise the logistic issues start piling up and harm the setting.
  • sircastor 1 day ago
    My goal is to capture unfiltered thoughts in Obsidian. This is appealing to me because it's fundamentally just Markdown. It syncs across devices (iCloud for me, though any synced storage would work)

    That said, most of the time it's just new tabs in VSCode. Most of the time I'm not saving them as documents. I've tried a couple of times to install plugins that support a "notes" feature, but none of them have ever really held my attention.

  • vunderba 1 day ago
    I'm making the assumption that "taking notes" is distinct from commenting one's code.

    If it's related to a long-term contract, I'll create a company-specific Obsidian vault which I'll later sync to a org-wide Notion database.

    If it's personal I usually add any relevant documentation/diagrams to the repo itself under a docs folder.

  • codingdave 1 day ago
    If it is something I need to resolve for my current work, a comment: // TODO... And then I search for TODOs before pushing any code to the team.

    If it is something to work on or research myself, but not part of the current work, I have a running TODO list in its own text file.

    If it is something that anyone on the team could work on, I put notes or a task in whatever tracking system my team uses.

  • ecesena 1 day ago
    Mostly notebook, I used a very simplified version of the bullet journal (you can look for "signifiers"). https://bulletjournal.com/blogs/faq

    I also use apple notes for quick & dirty notes, especially if I have to copy&paste or need to remember links. I tend to use a single note and clear it periodically, I'm not trying to accumulate knowledge here.

  • karmakaze 1 day ago
    More tabs in Sublime Text than it can display. It's a perfect scratchpad since it survives version updates and reboots and you never need to save or name tabs.

    Surprisingly notes are a lot like browser bookmarks, they work pretty well as a write-only medium. An LLM search function for tabs would make it perfect.

    If I want to run command-line utilities on it, I save it to a file (instead of putting in Sublime) named 1, 2, or rarely 3.

  • greenhopefully 18 hours ago
    Antinote, it's very useful. I found out about it on Reddit a month ago.

    https://antinote.io/

  • dugmartin 1 day ago
    These days I use this VS Code extension and have 1 note pinned as the first tab per repo. It acts as both a temp scratchpad and long term note location.

    https://marketplace.visualstudio.com/items?itemName=dionmunk...

  • mmphosis 1 day ago
    I try not to. Failing that, in a text file named notes.txt. Failing that, in comments in the makefile, in the code. Failing that, in a commit comment. Failing that, in a journal of some kind to describe what failed.
  • hwpythonner 1 day ago
    Depends. Usually a mix of comments in the code before committing, text files, markdown notes, and whatever internal task system we’re using (Jira-style).

    I haven’t found a silver bullet that makes all of that feel cohesive. It's usually a balance between “what’s fast right now” and “what future me might understand.”

  • jellyfishbeaver 1 day ago
    Comments in the code for items that need to be addressed before final review. e.g. "XXX: Blah blah.." or "TODO: Investigate blah blah". For other types of notes useful to future me or someone else coming back to the task/feature in the future, mostly Jira comments
  • runjake 14 hours ago
    Code comments, README.md, TODO.md, or Obsidian notes.
  • throwaway173738 1 day ago
    I keep a legal pad next to my keyboard and hand write things in it.
  • softwaredoug 1 day ago
    For very intricate code - literally print code out and find a quiet corner and get a pen. Reduce distractions. Mark it up like I’m reading a complex piece of literature.
    • bediger4000 1 day ago
      I do this, too, but I also delete all the comments before printing to avoid cognitive bias induced by the comments.
  • snvzz 1 day ago
    Plain text files.
  • 0xCE0 17 hours ago
    I use plain and simple .txt files.
  • account-5 1 day ago
    Treesheets and paper and pencil, preferably squared math paper. I weirdly find comfort in boxes...
  • thesuavefactor 1 day ago
    I use logseq a lot. Not just for development notes, but notes in general.
  • jarvisgrant 1 day ago
    The code is notes
  • PaulHoule 1 day ago
    As comments in the code sometimes, comments in JIRA sometimes, sometimes text files.
  • imvetri 15 hours ago
    Console.log(write your content)
  • palata 1 day ago
    Paper notebook and pen.