-
Notifications
You must be signed in to change notification settings - Fork 241
Keeping Your Mental Kitchen Clean
Every good cook knows it's easier, faster and more enjoyable to work in a clean kitchen than a messy one. Food scraps and dishes left out on the counter pile up and get in your way, slowing you down and confusing you. You have to think about each dirty pot every time you look at it, even if only for a millisecond. Better to wash each dish right when you're done, and throw away each food scrap right when you're done chopping that vegetable. (And better to keep a refuse bowl right there on the counter rather than making separate walks to the trash can every two seconds.)
If your working environment is a kitchen, you'll be able to code more quickly and enjoyably if you keep it clean. I mean this in the sense that you should keep your physical working environment clean and neat, but not just that. You should keep your computer and consciousness tidy as well.
Physical clutter translates to mental clutter. Keep your desk as neat as possible. Clear it of all unnecessary objects. (Your phone is an especially unnecessary object.)
- Try setting aside chunks of time to keep Slack and email closed. You may find that these times are fantastically productive for you. Even just an hour a day of interruption-free time can provide a surprising boost in productivity. You may find yourself wishing to work this way almost all the time. (I, Jason, only keep email open for about 30 minutes a day.)
- Don't keep a thousand browser tabs open at once. You have limited cognitive power to be used in a day, and it costs more cognitive power to manage a bunch of tabs than it does to "recover" a closed tab. Shoot for having three or fewer tabs open at any given time. Two or three, not 35.
- Don't keep a bunch of tabs open in your text editor, either, for the same reason. Learn how to quickly open new files. In Sublime, Ctrl + P will let you open a new file by starting to type its name. Ctrl + O does the same thing in JetBrains editors. If for some crazy reason you're using vim, use FuzzyFinder.
- Prefer big windows to little ones. If you're editing code, edit code. Use the whole screen for it. Switch among windows quickly by using Cmd + Tab rather than trying to fit all your windows onto a page.
- Every time you type a full command when you could have autocompleted, or click when you could have used a shortcut key, you're expending precious limited cognitive power. Keep learning shortcuts for repetitive actions.
- Do one thing at a time. Finish one task before moving onto the next. If you find a new bug while working on a task, don't pause the task and try to go chase down the bug. Create a new issue for the bug and keep your momentum on the task on which you were working.
- Think before you act. Before you start a task, pause for a moment to think it through. Do you know everything you know to complete the task? Do you have a design or a plan to follow? For anything but the tiniest tasks, it's a good idea to break the task into small parts and list the small parts. Write out a "script" on paper so that as you're coding, you can just follow your script, and you don't have to pause as much to think, "Hmm...what the heck should I do next?" Plan all that stuff out in advance.
- Defer as much thinking as possible. If you're writing a function to send an email to all the administrators in an app, don't worry yet about how to get your hands on all the administrators. Just figure out how to send an email, period. That part is challenging enough by itself. Then, once you've figured out how to send an email, figure out how to send to three hard-coded emails. Finally, replace those three hard-coded emails with the actual list of administrators. Don't make your brain juggle five challenges at once.