Sunday, August 9, 2020

Take Good Notes

Software developers have to keep track of a lot of disparate things. When debugging a knotty problem, for example, the solution process might involve references to issues, source control branches, downloaded test data, snippets from Slack or email conversations, stackoverflow questions, API documentation, etc. If you can pull all those items together into a single, searchable place, you will be much more effective. For a long time I didn't have a system like that in place, and then one day, I did. This is how I got there.

I read David Allen's book Getting Things Done in 2007 or so, and it made a big impression on me. One of his big tenets is that you have an "inbox" of things you have to deal with, and periodically and in various ways you work your way through the inbox, either taking care of things right away (make a phone call, send an email, pay a bill, etc) schedule something for later, delete it (i.e. throw it in the trash), file it as reference material, that sort of thing.

I followed his methodology for a while, and it works well if you can stick to it, but one thing that hung me up at the time was the "file for reference" bit. By this time, most information was digital, not on paper, and filing it meant... what, exactly? Perhaps wisely, David Allen didn't give detailed advice on implementing his system using tools that would quickly make the book outdated, I could, of course, just save items as files to the hard drive, but how to organize them? How to find them later? How to reference one item from another? What if I wasn't on that particular computer when I needed to refer to them? I saw coworkers use various digital Post-It note programs at the time, but these seemed to suffer from some of the same problems.

One attempt was to create a personal Wiki. This was a decent solution for notes and information that I typed myself, or could paste from another source, but was far from perfect. There was still the wiki markup to deal with, and while it wasn't that complicated, it was still a bit of cognitive friction to just getting my thoughts down as rapidly as possible. If you wanted to add an image, it was a cumbersome process of uploading it, then referring to it.

Then there were paper notebooks. For years I had used composition books as "field notebooks" at work, logging thoughts on software designs, bug writeups, sketching architectural diagrams, etc. This worked reasonably well, except I like things to be quickly searchable. Oh, and writing longhand for me is slower than typing and the results are not particularly legible. (You may have heard about studies that found that hand-writing notes leads to better retention of the information. This may very well be true, but usually I'm not writing to retain or memorize.)

Evernote logo
This is where things stood a few years later when a coworker gave her notice and bequeathed to me a collection of notes from some projects I was inheriting. She had exported the notes from Evernote, and the easiest way to access them was to create an Evernote account and import them. I had heard of Evernote and its brethren (OneNote, etc) but had not taken the plunge on a modern note-taking app. I created a free account, and was off to the races. I quickly started using it to take notes from work meetings and calls. I found it was very good for "software development field notes", particularly when troubleshooting problems. You could paste in exception text and log messages, and document the things you tried and what the results were. Then I started adding notes for feature ideas, or detailing a difficult setup procedure. 

I soon started using Evernote for non-work things as well. It's great for managing small- to medium-sized projects like "Buy a car" or "House electrical work".  Pretty soon it reached the point where it just contained the details of my life. Evernote's icon is an elephant, and that's apt - it holds all the details that my own memory certainly doesn't hold very well anymore (if it ever did).

What Evernote Gets Right


When you create a new note, you can just start typing. You don't need to worry about formatting, unless you want to. If the thoughts are pouring out of your brain, or you're taking meeting notes in real time, don't worry about typos, formatting, and capitalization - go back and fix them later. Or don't bother - it's your personal system, so do what works for you. Abbreviate long words you're using a lot, then go back and replace them later (or keep the abbreviations). For example, if you're writing a lot about microservices, just write "ms".
 
The note editor has the usual "light formatting" options such as bold, italics, bulleted and numbered lists, links, images, blockquotes, etc.


I wish there was a Markdown input mode for technical content. There is a code block formatting option, which on the OSX version you can trigger with the Markdown-like triple-backslash
(For some reason this is not available on the Windows version - you have to choose Style > Code Block from the right-click or Format menu, or use the keyboard shortcut Ctrl-Shift-L.)

It's very easy to paste an image into a note from the clipboard, which is especially useful for screenshots. It will also perform optical character recognition (OCR) on images, scans, and PDFs, which is mostly used when searching.

Your data is continually saved in the cloud, and synched to all of your devices automatically. It's available on all of your mobile devices, of course, which is great when you want to jot down a quick gift idea when you're out and about, for example.

Organizing Your Notes

 
You can organize notes however you like. You can set up separate notebooks for different realms (work, home, volunteering, etc) or use tags, or both. I mostly use tags, as things often spill across different contexts. Tagging works as you expect - there is a many-to-many relationship between tags and notes. I don't go too crazy adding tags, as the full-text search functionality works pretty well. Most notes tend to have one or two tags. Doing a full-text search combined with filtering on a tag is particularly effective.

I also keep the number of notebooks to a minimum - I have one primary notebook into which I put both current work and non-work notes. I tag anything work-related as "work", along with more project-specific tags. On those occasions when I change jobs, I archive the notes from the old job by moving then to their own notebook. 

Another really useful tactic is to make your own wiki-style links between related notes. This is great for adding "see also" links, and for breaking up notes that are getting too long into several.

Checking The Box and Searching


You can also include checkboxes in your notes, which gives you the ability to make to-do lists and the like:

Naturally, there's a keyboard shortcut for that - Ctrl-Shift-C on Windows and Cmd-Shift-T on Mac. You can also just type a pair of square brackets (like how you would show a checkbox in ASCII) and it will automatically turn it into a checkbox for you.

Particularly when you're working on a greenfield project, you tend to have lots of to-do items that you need to come back to. Sometimes TODO comments in the code or the readme are the best way to do this, but sometimes it's easier to dump them out into the note you're in the middle of, especially if they're not related to code changes.
 
You can set up customized searches within Evernote. A couple I find particularly useful are:
  • Work To Do - all notes tagged work that have at least one unchecked checkbox
  • Non-Work To Do - all notes NOT tagged work that have at least one unchecked checkbox 
  • Not Work - mostly used to find recent notes that I've forgotten to tag as "work"
I spend a good part of my workday in Evernote, so I put a little extra effort in making sure my future self can find things quickly. For example, if I take notes while troubleshooting a bug, I put the ticket number in the note title. Or, if there is a particular thing that is referred to in different ways, like by abbreviation or fully spelled-out, I make sure both are included in the note so searching on either form will locate it.

Outside of Work


I end up taking notes for a lot of non-work stuff, too, such as medical history, food diaries, car and house repairs, project ideas, book summaries, etc. It's especially good to keep track of gift ideas for friends and family (or yourself!), and lists of books to read or movie recommendations.

Clipping It


One nice feature of Evernote is its Web Clipper browser plugin, which allows you to save a snapshot of a web page as a note. This helps to solve the "too many browser tabs open" problem. When you find a page that has a lot of good reference information in it (in the GTD sense), you can clip it. It does a very good job of removing the menus and other fluff and keeping just the body of the page. Since it saves a copy of the content, you're protected against the page going away in the future or moving to a different location.

Thursday, June 18, 2020

Useful Keyboard Shortcuts (Windows Edition)

If you're a developer who doesn't use a lot of keyboard shortcuts, you may have a vague sense that you should be using them more, or you've read that the "cool kids" (i.e. the really smart and productive developers) use them all the time and hardly ever touch the mouse. I'm here to tell you it's true - it does make you more productive.  A little effort to use more keyboard shortcuts and fewer mouse actions really pays off.  Just by speeding up common actions, you can better keep up with your own brain. Even if you like your mouse, if you're on a laptop without a mouse, you may find the keyboard shortcuts less annoying (and more accurate) than using the trackpad (or the little pointy-thingy in the middle of the keyboard).

 

Windows Key Shortcuts

I went years completely ignoring the humble Windows key, but it turns out it does a lot of useful stuff!

 

Windows key by itself

Tapping the Windows key brings up the start menu, and places the cursor right in the search/run box. This is a great way to launch apps or files, or do searches. It also has nice autocomplete functionality. Note that Ctrl-Esc does the same thing, but why use two keys when you can use one?

 

Windows key combinations

Win-X -This gives you a quick menu with a lot of useful system actions:


Win-Up - Maximizes the current window.

Win-Down - If current window is maximized, will change it to "normal" mode (unmaximized). If unmaximized, it will minimize the window. So you can go from maximized to minimized by doing Win-Down twice.

Win-Shift-Left, Win-Shift-Right - Moves the current window to the next monitor to the left/right. I'm not a big fan of three-key combinations (sometimes called "chords") but this one is an absolute godsend if you use multiple monitors.

Win-L - Lock the screen. Quicker than ctrl-alt-del, then choosing "lock screen". This is handy in a work environment when your company security policy requires you to lock your workstation when not at your desk, or when working in any other public place.

Win-M - Minimize all windows. Handy for "tidying up" when you have a lot of windows open all over the screen.

Win-Left, Win-Right - Tile the current window to the left half/right half of the screen. This is particularly useful when you've only got one monitor, but you need to refer to two apps at the same time. Also useful if you want to compare two versions of something side-by-side, but for some reason you can't use a diffing tool. Maybe you have two similar Word documents or something like that.

 

Alt Key Shortcuts

Alt key shortcuts also tend to do things at the operating system level, rather at the individual application level.

Alt-Tab - Switch between open applications/window. This is the big enchilada - it allows you to switch to a different window quickly. Doing a quick alt-tab and releasing will switch to the last window you used, which is very handy for switching back and forth between two windows. Holding down the Alt key, you can keep hitting Tab and it will cycle through all the open windows, or you can use the arrow keys to navigate more directly to the one you want.



If you have multiple screens, it can be difficult to find the mouse pointer sometimes (at least for me), and this slows me down if I want to switch to a new application by clicking on the app on the taskbar. Alt-Tab lets you go to the application you want to without needing to know where the mouse is - when you finish, you have focus in the application.

Alt-F4 - Closes the current window. This is very useful, but unfortunately I find this a bit of a "finger stretcher." Side note: why doesn't Alt-W close a window, analogous to how Ctrl-W (see below) closes a document within an application?

Alt-Spacebar - This displays the current window's System menu:


I don't use this often, but it's really useful if you're in the catch-22 where the top of the window is off the screen and you need to grab the top of the window in order to move it all onto the screen.

 

Ctrl Key Shortcuts

Control (Ctrl) key shortcuts usually work within an application, and fortunately there's a lot of standard behavior that works in most programs.

Ctrl-X, Ctrl-C, Ctrl-V - Cut, Copy, Paste. If you're not already using these, stop right now, learn them, and practice them so you'll never need to go to the Edit menu for these again.
Ctrl-Z - Undo. What I said about Cut, Copy and Paste applies here as well.
Ctrl-A - Select All in current document or page
Ctrl-S - Save current document/file etc.
Ctrl-O - Open File
Ctrl-N - New (File, Document, etc.)
Ctrl-F - Find, usually "Find in current document" or "Find in current page".
Ctrl-H - Very often this is Find and replace in current document (or current page).

Once you get those down, these would be the next ones to start fooling with:

Ctrl-W - Close current tab or document (within multiple tab or multiple document application). In Visual Studio this is Ctrl-F4 by default (although you can change it to Ctrl-W).
Ctrl-G - In an editor, this is usually "Go to line"; i.e. typing "Ctrl-G 47" will take you to line 47 of the current file.
Ctrl-I - In an editor with formatting capabilities, this will often toggle italics on/off for the selected text.
Ctrl-B - In an editor with formatting capabilities, this will often toggle bold on/off for the selected text.
Ctrl-Tab - In multiple-document or multiple-tab applications, often cycles through tabs or allows you select tabs or open documents similar to how Alt-Tab works.
Ctrl-T - in an application with multiple tabs, this is often "New Tab".
Ctrl-+, Ctrl-- - Increase or decrease font size. In particular, "Increase Font Size" is extremely useful for those of us who have reached, shall we say, a certain "maturity level".
Ctrl-K - In an editor or email client, this will often allow you to set a hyperlink for the selected text. If you have the URL in the clipboard, this then becomes a matter of selecting the text, then pressing Ctrl-K, Ctrl-V

 

The Rest - Navigation, etc.

If you start using more keyboard shortcuts, you may notice that "keyboard shortcut use begets more keyboard shortcut use." In other words, once you start keeping your hands on the keyboard more, you may find yourself looking for more ways to keep them there. This may happen in part because once you've been ignoring the mouse pointer for a few minutes, you may have trouble finding it again, particularly if you have multiple screens.

Aside: To help with this, you can change your mouse settings so tapping the Ctrl key will give you a visual indication of where the mouse pointer is. Here's what the setting looks like:


Here are some other keyboard actions to help you stay on the keyboard.

Tab - go to the next input field in a form. Shift-tab goes to the previous one.
Enter - click the button with the current focus
Esc - Cancel the current dialog or operation. You probably already knew about this one, but you may find yourself using it a lot more if you're more keyboard-oriented.
Arrow keys, PgUp, PgDown, Home, End - Likewise, use these to navigate through a document or page in a text editor, browser, email client, etc.
Ctrl-Left Arrow, Ctrl-Right Arrow - Navigate one word left or right.
Ctrl-Home - Go to the top of the document or page
Ctrl-End - Go to the bottom of the document or page

 

Learn a Few at a Time

Rather than trying to learn a lot of these at once, what has worked better for me is to focus on a few, getting them "under my fingers," then moving on to others. Little posted cheat-sheets like this are helpful:

 

Browser Shortcuts

Everybody spends a good bit of time in a web browser, so knowing a few shortcuts there can really pay off.

Ctrl-T - Open a new tab
Ctrl-W - Close current tab
Ctrl-Tab - Go to the tab to the right of the current tab (this is sometimes configurable depending on the browser and plugins. For example, it may take you to the last tab used)
Shift-Ctrl-Tab - Go to the tab to the left of the current one
Ctrl-L - Go to the location bar, and select the current URL (so if you just start typing a new URL or search phrase, it will replace what's there)
F5 - Reload the current page
Backspace - Go back to the previous page (or previous point in history). In other words it works like the Back button.
F12 - Open Developer Tools

 

Application-Specific Shortcuts

If you've come this far, you're ready to really optimize. Figure out what tools you use the most, and then work to get familiar with those tools. You probably want to get good with the keyboard shortcuts in your email client, whatever it is. If you're in finance and you spend all day in Excel, optimize the crap out of Excel. Part of being a professional is becoming an expert at the tools you use in your profession every day.