<< Newer Article #231 Older >>

An Ode to CodeWarrior

As a Mac programmer in the 1990's, you quickly learned to swear by Metrowerks CodeWarrior as your development environment. It was awesome for its time: a completely integrated system with ripping fast compilers, a built-in debugger, and a very nice editor.

Eventually, the company decided to branch out of Mac tools (Apple never seemed to be all that thrilled to have a competitor that, frankly, wiped the floor with them), and they moved into other areas: Java tools and embedded compilers. They also ported their environment to Windows, which was nice for those of us Mac programmers who were just starting to get our feet wet in the Windows world.

In the end, however, the market for a real 3rd party compiler withered and died on the Mac front, and never really took hold on the Windows front. Metrowerks was purchased by Motorola, they focused on their Windows-hosted embedded toolset, and eventually disappeared. The last version of CodeWarrior I bought was CodeWarrior 8 for Windows, released back in 1992.

But in my world, CodeWarrior lives on!

Because once you spend a number of years with an editor that you really like and get to know, it is difficult to switch to another. Yes, sure, there are tons of full-featured editors out there, many of which can be custom-tweaked to perform a good chunk of what the CodeWarrior environment's editor did. But every time I have tried, I found myself crawling back to the old standby within a week or two, missing some feature I just couldn't live without.

That's not to say CodeWarrior is perfect; far from it. It has a nasty GDI leak during search & replace that causes it to eventually crash when it hits the Windows maximum per-process limit (fortunately you can increase that number in the registry!) And its interface on Windows is a bit goofy, with a centralized menubar like on the classic MacOS, and toolbars which I immediately turn off. Not to mention it got even a bit goofier on Vista, with the wide window borders.

But there are too many features I constantly rely on to give it up. Here's my top 10 list of favorite features:

  1. No MDI. Those of us who came from the Mac always thought that one of Windows' most horrible user interface gaffes was the introduction of a single parent window that contained all your document windows. What this does for coders is it makes you immediately maximize your parent window so you get the most real estate. Except you only maximize to a single monitor, so you are inherently limiting where you can put your windows. And you are wasting a ton of space. To appeal to those who were used to this abomination, Metrowerks defaulted to an MDI mode in their Windows port, but thankfully you could turn it off. The resulting interface was a bit odd, with a small parent window containing just a menubar, but at least you could see the files you were editing alongside other useful data in other applications' windows. Amazing!
  2. Infinitely divisible windows. Sometimes you need to look at two different parts of the same file at the same time. Sometimes you need to look at more than two parts of the same file at the same time. Sure, many editors allow you to split a document into two panels, but they almost all only allow you to split the document once, and then only vertically — what the hell? My nice widescreen monitor allows me plenty of room to see two or three views of the document side-by-side! With CodeWarrior you could split each window into as many views of the same document as you wanted, vertically or horizontally. I've yet to see a good answer to this.
  3. Ctrl+E enters the selected text into the search field of the search & replace dialog. Shift+Ctrl+E enters the selected text into the replace field. With these two key combinations, I rarely need to ever bring up a dialog to search & replace. I simply select the example I want to change, Ctrl+E, type over it with the new text, select that, Shift+Ctrl+E, and then use the many other additional shortcut keys to perform the replace over the rest of the document.
  4. Multi-file regular expression search & replace. I use this all the time. You can operate on all opened files, recursively over an entire folder tree, or only over selected files. Recently searched directory trees are available in a popup menu. Making global project-wide changes with this feature is a snap, and you can do it either all at once or one at a time using shortcuts.
  5. Awesome directory and file compare. Simply select two files or two directories and it will compare them and display them side-by-side with a very nice visualization of the differences and the ability to apply/unapply changes. Nicer diff/merge utilities have come about since this one, but this was one of the first truly excellent compares I ever experienced.
  6. Function popups. The editor would scan your C/C++ code, find the function names, and create a popup of available functions on the fly. No need to compile the file to generate browse information — it's built right into the editor and updated dynamically.
  7. Configurable length of recent documents list. Yep, a minor feature, but I set this to 40 and have a nice long list of recent documents I can skip back to very quickly.
  8. Page navigation without cursor movement. Off with the default Windows key mappings, this feature comes from the Mac, where the page up/down keys did not move the cursor, but instead simply scrolled. This was handy for keyboard navigation. You would use page up/down to scan for something you were looking for and the cursor would stay put. You could also his the Enter key on the keypad to quickly recenter the screen on the cursor.
  9. Open header file shortcut. This is the simplest feature yet extremely handy. If you are editing a .c or .cpp file, Ctrl+Backquote opens the .h file with the same name in the same directory if it exists. And if you are in the .h file, the same shortcut opens the corresponding .c or .cpp file.
  10. Quick file access. Select the name of a file in a text file, hit Ctrl+D, and the editor would search the current directory for a file with a name matching the selected text and open that file. Highly useful for #includes. If you have no text selected, you can still hit Ctrl+D and it will bring up a dialog asking you to type the name, which it then searches for in the same directory relative to the file you were editing. I use this all the time for navigating between files without leaving the editor or bringing up the open file dialog.

Suffice to say, I am many times slower without the help of all these features. Maybe someday I'll write my own editor and incorporate everything I want into it, but as long as CodeWarrior keeps on working, I'll probably just stick with what I love.