Optimise your Windows programming environment
In an ideal world every developer would be given fast computers, two high resolution monitors and the choice between Linux and Windows. Unfortunately this is rarely the case. I'm stuck with Windows - which is great for web browsing and creating Power Point presentations - but it doesn't really cut it for programming tasks out of the box.
This post outlines some of the programs I have installed, and the configurations I have used to make Windows a bearable programming environment. All applications have been chosen for their simplicity, low ram foot print and free availability. Any changes to Windows settings have been selected to either provide better information at a glance or reduce click count. The only prerequisites for applying these changes are that you know how to edit the registry and edit your path environmental variable.
Text Editor
Programming involves huge amounts of plain text manipulation whether it be source files, make files, scripts etc. What does Windows provide to edit these? Notepad.
I think the minimum one should expect from a plain text editor is: syntax highlighting, auto indentation, block indentation, parenthesis checking, a good search utility (across multiple files with regular expressions), a tabbed interface for multiple documents and speed. The final feature might sound obvious (it is just a text editor) but IDEs loaded with unnecessary features or even the most simple editor written in Java has the tendency to be slow.
I recommend Programmers' Notepad. Pn supports syntax highlighting for multiple languages including C/C++, perl, html and many others. It is fast as it is written natively for Win32. It's intuitive and has everything you would expect.
Even if you use an IDE for your primary development I would recommend getting hold of pn, you will always need a text editor to knock up scripts or html pages and there is no need to resort to using Notepad. Personally I will only ever use an IDE if I need to use the integrated debugger (which is rare because I work with hardware).
You'll want to associate your source files with pn2 (.cpp, .h etc.), however I come across new file types all the time and some I do not want to associate with an editor (e.g. .html, .bat, .pl). I avoid file association problems by adding an "Open with Programmers' Notepad" into my explorer context (right-click) menu.
[HKEY_LOCAL_MACHINE\SOFTWAREI've also included "C:\Program Files\Programmers Notepad;" in my path so it can be opened from the command line by typing pn filename\Classes\*\Shell\Open with Programmers Notepad 2\command]
default="C:\Program Files\Programmers Notepad\pn.exe %1"
Text Comparison
When you have multiple versions of code kicking around a comparison tool is essential for quickly examining what has changed.
Unfortunately I couldn't find a free app that rivals Beyond Compare ($30). I use this because the company I work for has a site license. I've tried a few free alternatives and by far the most superior is WinMerge. This app provides a clean simple interface for text file comparison and you can edit text within the differencing pain (unlike KDiff3). The directory comparison utility isn't great so I'm still on the look out for something better.
Both Beyond Compare and WinMerge provide quick comparisons through the explorer context menu.
Hex Editor
If your developing anything for hardware, dealing with file systems or communications you will require a hex editor to read binary files.
I recommend ICY Hexplorer. It provides simple hex editing and colour schemes to highlight ASCII text, NULL bytes etc.
It is unlikely that you would ever want to associate a binary file (e.g. .exe) with an editor, so as before I've added an "Open with Hexplorer" option to my explorer context menu.
[HKEY_LOCAL_MACHINE\SOFTWARECommand Line\Classes\*\Shell\Open with Hexplorer\command]
default="C:\Program Files\hexplorer\hexplo.exe %1"
I don't think anyone really likes DOS. I know lots of people who use cygwin, but I'm not keen on it as some things have to be done in DOS meaning you'll have to split what you're doing over two shells. To make the Windows Command Line Interface better I have done the following things:
Enabled TAB auto completion - This is not default in Windows2000 which is a disgrace.
[HKEY_CURRENT_USER/SoftwareInstalled unixutils - These are native Win32 ports of standard Unix utilities including grep, sed, tr, vi, cat etc. Put the \unixutils\usr\local\wbin directory in your path so you can access them from directory./Microsoft/Command Processor]
CompletionChar=9
PathCompletionChar=9
Installed Console - An interface on top of cmd.exe. It provides better layout options (font, transparency etc.) and multiple consoles in tabs.
Reusable Scripts Directory
Useful scripts and batch files get shoved into d:\scripts which is made globally accessible by adding it to the path environmental variable.
Obvious examples..
Quick navigation:
d \really\really\really\ridiculouBetter formatting with showpath:sly\long\directory\tree
echo %path% | tr ';' '\n'
Personal Wiki
While not a Windows specific tip I use TiddlyWiki to note down useful bits and pieces such as:
- Awesome regular expressions that I might want to reuse
- Documents I'm currently writing (before I export them to the Word)
- Useful bits of code
- Todo list
- Anything I might want to remember
Cheat Sheets
Again not a Windows specific tip, but for ultra quick reference no programmer's desk would be complete without a cheat sheet. Check out ILoveJackDaniels for some pre-made ones including regular expressions .
Disable desktop icons
I don't like desktop icons, you're required to minimize everything you're working on to get to them and the desktop often becomes a dumping ground for crap. A clear desktop encourages storing files in a proper place. Disable them by right clicking on the desktop: Arrange Icons By -> Show Desktop icons.
Apply a consistent view to all folders
I like details view with file extensions enabled and hidden files shown. It's nice to be able to see when the component you're about to export is full of hidden temporary files, and it's nice to be able to change the file extension without having to open a command prompt. I prefer details view so I can quickly see the sizes and date/time of last modification at a glance (very useful to check if a binary has really been compiled).
I won't insult you with how to set that up, but Tools -> Folder Options -> View(Tab) is your friend.
Windows Search
If you've followed the steps above you can use the build in search tool in pn2 or grep -r to search for text within files. However a regular search facility is still required to search for files by name. I haven't experimented with an indexed search system (like the one included in google desktop) as I download fresh code before making a change, not really giving enough time for it to be indexed. In Windows XP the default search dialogue sucks. You can make it a little bit better by reverting the interface back to a Windows 2000 feel:
F3 (brings up the search dialog) -> Change Preferences -> Without an animated character
and
Change files and folders search behavior -> Advanced (lol)
When you disable the animated dog, it gives you one last smile and wanders off the screen.
2 comments:
Nice list!
Here's another vote for Programmer's Notepad.
After getting fed up with the overly bloated programs that we're given in work, I tested countless text editors and found it to have the best compromise between useful features and speed.
A close second is Notepad++.
As for text comparison, Beyond Compare is the nuts. Have you used any of the available plug-ins? I haven't, but would love to hear about them - they at least sound useful enough.
WinMerge is what I use at home (I have a proprietary software 'ban' at home!), but in work cannot seem to get it working - using either the installer or binary package - due to various DLL issues which I've never been in the mood to figure out.
Instead I use ExamDiff when I'm looking for a fast, lightweight comparison of plain text files and don't fancy firing up Beyond Compare. However, the standard version is pretty limited and you can't edit files or compare binary files or directories. The Pro version is pretty sweet though.
As for everything else you've written about... I couldn't agree more. Apart from maybe the Personal Wiki idea - I've never been a fan of them myself, but it's more a personal preference I guess. Also, I'm a big fan of the desktop (an uncluttered desktop though - 5 shortcut-folders maximum) as [Windows Key]+[D] is the keyboard shortcut that toggles the 'View Desktop' mode. I love it!
Kudos.
Hi Lloyd,
Glad to see we're on the same page :)
With regard to the Personal Wiki - I started keeping one after I spent about 10mins looking for a postit note with this scribbled on it:
zip -@ 92_068_TEST_BINARIES_ARMV5_UREL.ZIP < testbinaries.txt
By maintaining a wiki I have gathered a tome of useful info that I would have otherwise forgotten, or lost in old notebooks or postit notes. It does, however, require some discipline to keep it up to date, but in the long run it is a really useful resource.
Post a Comment