Saturday, August 15, 2009

Faithful Old Development Tools

I had the opportunity to visit Yellowstone National Park this past week for the first time in many years. One of Yellowstone's most famous attractions is the Old Faithful geyser. This geyser is so named because it relatively faithfully keeps to its eruption schedule. There is some variance, but most of us who have gone to watch it erupt at its scheduled time have not gone in vain.



In this blog posting, I discuss some of the software development tools that have proven faithful for me for many years. In most cases, there are new and advanced tools available that I use more frequently, but I still find situations when the older tools are useful and I’m glad to have them around and to know how to apply them.

The vi Editor

Although I use an IDE for the majority of my development, I still find myself using vi (or a derivative) frequently. Indeed, I prefer IDEs that support a vi plugin or mode so that I can use some of my favorite vi commands within the IDE. There are many things IDEs do very well, but I find myself in situations fairly often where I don’t want to mess with the overhead of an IDE or its projects structure. In such cases, for reading files and making minor edits to well-understood files, I can work more quickly with vi than I can even with the best IDE. In addition, vi is on essentially any Linux or Unix machine I might find myself developing on. Vim and other vi derivatives have added numerous new features to those originally offered by vi to make it even easier to use. Although I am not an emacs user, emacs can provide similar advantages as vi and I know many developers who have emacs as their old faithful text editor.

Some Favorite vi Commands
• Use of period to repeat the last command repeatedly.
• Number before yy to yank that number of lines and p to place them.
• Number before dd to delete that number of lines.
:x to save and exit (rather than :wq)
:n where n is a line number to go immediately to that line number
/expression to search for 'expression' and then n to 'next' searched for expression
:%s/thingToReplace/ThingtoReplaceWith/g (global search and replace)

Some of vi’s advantages can be experienced in IDEs by learning that particular IDE’s keyboard shortcuts, but I have used vi for so many years that its commands that I most frequently use are old familiar friends.


Basic HTML

I move between development of web applications and development of desktop applications frequently. However, I have found basic HTML skills to be very useful even when developing applications without absolutely no web component and even when developing Flex-based or OpenLaszlo-based web applications when relatively little HTML is required.

The reason that I have found HTML to be so useful in any type of development has largely to do with the pervasiveness of the web browser in daily life and in development life. Understanding basic HTML allows one greater flexibility in the customization of common development communication aids like Wiki pages, blogs, and static web pages. Knowledge of HTML can lead to more effective Javadoc comments because Javadoc is designed with web browsers in mind and renders HTML in the generated documentation. HTML is even used in non-HTML components in Java, Flex, and OpenLaszlo.

Favorite HTML Tips in Non-Web Development
<ul><li></li></ul> or <ol><li></li></ol> for bulleted and numbered lists respectively, especially in Javadoc comments.
<span style=”css style goes here”></span> in Javadoc comments, in Wiki pages, and other communication devices to provide easily modifiable CSS support.
• Decorative tags (when too lazy to use CSS stylization) like <strong> and <emphasis>
• "title" attribute to easily apply hover-over comments

I'll sometimes use HTML in these uses outside of actual web applications that I would never dream of using in a "real" web application because in such cases, complete adherence to strict (X)HTML and CSS standards is unnecessary and reduces the efficiency benefits I'm striving for in these uses.


Basic Java Tools: javac and jar

With the prevalence of IDEs and sophisticated build tools like Ant and Maven, it is easy to go quite a while without using the javac and jar commands. However, I have found knowledge of direct use of these to be useful in many situations. Just as vi is present on virtually every Linux and Unix machine, javac and jar will be on any machine configured with a Java SDK even if an IDE or build tool has not been installed. There are times when a proficient user of jar can view and manipulate contents of a JAR file quicker than using any tool or IDE. Of course, I prefer to have an Ant build.xml file for repetitive tasks, but for tasks that I only need to do once, it is often quicker to just use jar directly.

The jps command is one that is not quite as old as some of the other tools listed here, but is increasingly winning me over as an old friend. I have also used JAR to unzip a zipped file on a machine on which I was unable to find a tool specifically for unzipping files (usually on an older Windows box because Unix/Linux boxes usually have unzip).



SQL*Plus

For many years, SQL*Plus was the standard method of viewing and manipulating Oracle database schema contents. For a more sophisticated experience, users tended to use products offered by third party companies such as Quest Software. Today, there are numerous options for viewing an Oracle database schema and manipulating its contents graphically and many of these are offered by Oracle. Example of this are the widely popular SQLDeveloper tool and the SQL Worksheet. In addition, Java IDEs support significant database interaction via JDBC drivers.

Although these new tools are all easier to use than SQL*Plus in most cases, there are still times when I go to SQL*Plus for “quick and dirty” queries and operations. This can be especially quick if I have pre-written SQL scripts that I can execute with the @ sign. In fact, for most of my presentations and demonstrations, I write SQL scripts to create and clean up my schemas and run these from SQL*Plus when needed. SQL*Plus knowledge is especially useful when one wants to maintain the database schema with scripts. SQL*Plus can be used by a script to manipulate the Oracle database.

Favorite SQL*Plus Commands and Tips
• set linesize XXXX to set the linesize to number of characters different than 80
set null <null> to have "" show up for null values rather than empty area
column some_column_name format some_format to set the viewable format of a particular column in SELECT statements
host some_command to run a command in the operating system host environment
ed to edit SQL statements in text editor
@ and @@ to run SQL*Plus scripts
select table_name from user_tables; to see list of tables
select constraint_name from user_constraints where constraint_type = ‘P’ and table_name = ‘SomeTableName’; to see the name of the primary key constraint on a given table
select u.constraint_name, u.table_name, c.column_name from user_constraints u, user_cons_columns c where u.constraint_type = ‘P’ and u.constraint_name = c.constraint_name and u.table_name = ‘SomeTableName’;

In many ways, the arguments for use of SQL*Plus can be applied to many command-line tool variants of administrative tools that have GUI counterparts. For example, graphical interfaces have made application server administration much easier, but there are still times when the fastest method of administration is via the command-line. As mentioned above, command-line tools also offer the advantage of being executed with scripts.



Paint

In some form or another, the Paint (or MSPaint) application has been included with Windows distributions for as long as I can remember. Combined with the "PrintScreen" button, I find this to be a very handy tool in both development and in writing blogs. It is often helpful when running into problems with fellow developers’ code to send them a screen snapshot indicating the error message or strange behavior exhibited in the application. Even in cases of text output, taking a snapshot can be almost as quick as copy and paste but can provide additional context at the same time.

Some editions of Vista include the Snipping Tool, which makes my use of Paint on a Windows system much less frequent. However, Snipping Tool and other more sophisticated screen capture tools are not always available on all systems, but Paint is on virtually all Windows systems.

Favorite Paint Tips
• Press the Print Screen button to save a snapshot of the Windows desktop to the clipboard.
• Open Paint and select Edit → Paste
• Click on the “Select” icon (dotted square) and then select the region of the pasted-in image you really want.
• Select Edit → Cut
• Select File → New and don’t save the old one
• Select Edit → Paste to paste in the reduced portion selected
• Use Image → Attributes to set hard constraints on height and width of image (these coordinates can be seen by moving cursor to various areas on image)
• Save File with chosen name and preferred format (I typically prefer PNG for development-related screen snapshots)
• Most of these commands have keyboard equivalents

Admittedly, Snipping Tool and other tools require far fewer steps to use than Paint does for this purpose, but basic Paint operations such as those listed above are invaluable when it is your only choice.


top

There are numerous tools available for understanding a system’s CPU and memory usage, but good old top has been a faithful tool for such purposes on Unix and Linux machines for many years.


The Up and Coming Old Faithful Development Tools

The tools I have covered in this blog post have proven their value over many years, in countless different situations and environments, and have steadily provided the assistance I needed from them. So, what tools are likely to join this group? Search engines in general and Google in particular are definitely leading contenders. I think most of us already realize their importance in software development. They have been around a number of years and it could be argued that powerful search engines are already old faithful development tools. Other candidates for old faithful development tools include the mature Java IDEs and VisualStudio and JConsole. VisualVM is a relatively new tool that could very well end up on this list in the near future.


Conclusion

Newer and better development tools are being released continually. However, even with the many benefits and advantages of these new tools, some old tools have repeatedly proven their faithfulness year after year and continue to be faithful and highly useful in the appropriate circumstances. Many of these older tools are "faithful" in the sense that they repeatedly do what is required and they are always or almost always are available when we need them. I have listed some of my favorite of the old faithful development tools here. What tools would be on your list?

3 comments:

TR Hockamier said...

great article!

takes me back to my earlier days of windows programming and text editors and my favorite was (still is frequently) Programmer's File Editor:
http://www.lancs.ac.uk/staff/steveb/cpaap/pfe/

thanks

Nicole Hamilton said...

I'd love to see my Hamilton C shell on your list. I just released a new version for Vista this summer that included a new 64-build. It just recently got a great review.

If you'd be willing to take a look at it and promise to post your honest opinion, good or bad, love it or hate it, call 'em just as you see 'em, it's yours free. (My contact info is there on my C shell information page.)

Dustin said...

Learn Vim Progressively is a nice recent post on learning and using vim. Here is a quote from that post: "Learn vim and it will be your last text editor. There isn’t any better text editor I know. Hard to learn, but incredible to use."

Dustin