Justin Jackson recently asked me on Twitter for my .Net productivity hacks. Here are some of the things I do, that I believe help me be a more productive programmer.
- Buy and use ReSharper.
- For all my projects that connect to SQL Server, I use a data access library I wrote (SQLHydra, available on GitHub – MIT license). It only takes only a few minutes to plug in to a new app. And it has a fluent interface that makes writing database code so simple, that it doesn’t interrupt my flow. Get your own data access library or ORM, and stop hand-crafting SqlCommand objects.
- Even on my personal projects, I use source control. Every so often, I need to use the ability to revert my current changes back to the previous version. I use Subversion, TortoiseSVN, and the VisualSVN plug-in.
- When I internationalize a project (which I pretty much do by default, nowadays), I put the resource files in a separate project. That way, if I add resource files for a new language, I only need to deploy the one resource project DLL. I don’t need to re-deploy the whole project – or worry about the possible versioning issues I’d need to deal with.
- I generally prefer enums over Boolean properties/return values. Then, when I eventually need to add a third state, I can quickly add another value to the enum – and not need to tear up all the code that was expecting a Boolean value.
- Some people say, “If you use the same bit of code in two places, then it probably needs to be in its own method”. I’d add, if you see it in two projects, then it probably needs to be in your utilities library that you re-use across your projects.
- Get an SSD drive and upgrade to Windows 8 (or 8.1). When I get an idea, and want to test it out, the time to boot up my computer and start working is only a few seconds. Back when I knew I had to wait over a minute until I could type my first line of code, I was much more likely to put it off until “later”.
- Develop in a virtual machine. I use VMWare Workstation. Yes, it does contradict my previous tip, by adding in a delay before I can start typing that first line of code. However, it also gives me a “work” computer and a “play” computer. So, when I’m in my programming VM, I’m less likely to decide suddenly start playing Minecraft – which isn’t installed in that VM.
- Set a reminder to check the system event log every week or two. If you see any errors in it, track them down before they eventually cause a serious problem.
- For every project, I have one sheet of paper with all the tasks on it (more sheets for bigger projects). When I have an idea, I write it down on the sheet – don’t filter it, to decide if it’s worth doing. That gets it out of my mind and lets me get back to concentrating on my work. At the end of the coding part of my day, I go through the list and remove anything that isn’t worth keeping. It’s also a nice bit of motivation to cross items off the list as they’re completed.
- Every night, decide what is the single most important thing to accomplish the next day. When I wake up, get to work on that thing.
- Don’t do a project where you’re doing more than one significant new thing. Besides being slow, due to multiple learning curves, it’s more likely to become frustrating and de-motivating. I recently decided to start building Windows Store Apps. But there’s a lot to do, to get your first app in the store. So I built the absolute simplest app I could think of. The only “new” thing I did with that project was “get an app into the app store”. Had I decided my first app should be some huge cloud-based app, I’d either still be working on it, or given up on it. Instead, only a few weeks later, I’m almost ready to submit another (more powerful and useful) app into the app store.
- Keep a clean desktop – computer and physical. Everything that gets in my line of sight gets a certain amount of my attention. The less clutter I have, the more I can stay focused on what I need to do.
- Build and follow a schedule. This is something I’m working on becoming better at. As much as I don’t like sitting in some company’s cubicle, it did have the positive result of getting my mind to say, “OK, it’s time to work.”
- If you can afford to hire someone to do something that you need done, that you don’t enjoy, and that isn’t what you want to be spending your time on, then hire them. I “outsource” my laundry, my apartment cleaning, and probably half my meals (to the many nearby restaurants).
- EXPERIMENTAL IDEA: Something I may start doing is split my day up into two “days”. It’s starting to get hot in Paraguay. So I’m thinking about taking a siesta after lunch – which should also help my body with recovering from the gym. They say the average office worker only gets three hours of actual work done per eight-hour day. I’d like to see if I can get two three-hour blocks in, one in my morning “day”, the other in my afternoon “day”. I’ll write again later, in case I do this, and let you know how well it works.
If you have any practices that make you a more productive developer, please share them in a comment below.