I spent a few minutes yesterday working on adding some code snippets to my personal collection as I refactored a bunch of code. And it got me to thinking about how to be more efficient while using my editor.
The main way to gain efficiency is to pick one editor or IDE, stick with it, and learn it inside-out. I have not followed my own advice; I started using Emacs, then went to Textpad on Windows, then Visual Studio 6. I then thought Eclipse would suit all my needs as I wrote mostly for the CDT and Perl (EPIC). But since I've started here at Scimatic, I've had to ramp up on Visual Studio, and stick with it.
There are five main areas I'd recommend for tweaking Windows with Visual Studio.
- Switch the meaning of Caps Lock and the CTRL key. Putting the CTRL key closer to your hand and avoiding an RSI will save you tonnes of time and effort.
- Pick a good programming font and colour scheme. I use Consolas (and Inconsolas on the Mac) for the font, and John Lam's excellent port of Vibrant Ink for the colour scheme. The black background is critical for giving your eyes a break after staring at the screen for a number of hours. One additional advantage is that the blue markings for interfaces versus the bright yellow for class help you see when you're writing hard-to-test code, as demonstrated in this post by Chris Missal.
- Tweak your key shortcuts to suit. For example, I prefer CTRL-/ and SHIFT-CTRL-/ for commenting a set of code. And I've also changed the Function keys to start debugging to match what Eclipse does. YMMV, but get it to the point where you can run it with your eyes closed (or not looking at the keyboard or using the mouse).
- Learn as many keyboard shortcuts as possible, especially the multiple key "chords" that unlock additional functionality. For example, CTRL-K-CTRL-S to surround a selected code block with a snippet.
- Add custom code snippets and macros to automate repetitive code.
But most importantly, learn to touch type! It's the key to all of the above, and so much faster than reaching for the mouse all the time.
