Tiny Code

Tiny Code

Tuesday, January 15, 2013

Portable tools

Having written software on a variety of development systems including Sun workstations, Windows PCs, Linux PCs, and Macs, I've never regretted the decision to choose easily portable tools for use in my daily work.  By doing so, I learn a tool once and am able to use it regardless of what type of development system I am given at a new company.  I also have a preference for free software.  In the past it's been difficult if not impossible to get companies to pay for software tools.  Having a ready arsenal of free tools for any system I use is a huge bonus.

My editor of choice these days is one of the GUI versions of Vim (MacVim at home and GVim on the Windows PCs at work).  Besides the obvious enhancements which either version of Vim adds to the standard vi commands, the developer who started the project, Bram Moolenaar, runs the project as charity-ware with donations going to help children in Uganda.  I've got no problems donating to such a worthy cause.

I continue to use vi clones because vi was available on most of the systems I've used over the past 20+ years.  Using PCs in the early days, I chose vi over emacs because early ports of emacs were extremely resource intensive.  While vi would fit easily in a 40 KB .COM file which could be executed from a floppy disk on base PCs, the emacs .EXE file (necessary because it required more than 64 KB of code space) typically required a PC with an expensive EMS board.  

Were I to be starting out these days, I believe I'd probably choose to learn UltraEdit or SlickEdit since both have Linux, Windows, and Mac versions.  Both editors also have a much less daunting learning curve.  At best, vi commands are perplexing to new users.  You really need to understand the history of vi to grasp why the commands are designed the way they are.  In a nutshell, software in the early days of Unix had to support a variety of dumb terminals.  Commands had to be formed from the common subset of keys available on all terminals.

If you combine Vim with Exuberant CTAGS, you have a very powerful programming editor which makes it easy to learn and to navigate unfamiliar source code.

I've also chosen the Bash shell as my daily command line interface.  It's available on Linux and Mac.  It can also easily be added to Windows systems as part of Cygwin.  Bash is much more powerful than the standard Windows command shell.  I've heard good things about PowerShell but since it's only available on Windows, it's not really an attractive option for me.

Aside from the tools above, I'm fond of AWK and SED.  Used either separately or combined with their Unix based brothers like xargs, find, and grep, they give an nearless endless variety of ways to manipulate text files.

I've got one last recommendation.  There's a great grep replacement for software developers called ack.  It makes it easy to restrict the files searched to just source files.  You can do the same thing with grep but the command line gets very complicated.

No comments: