views:

56

answers:

2

I've written a few desktop applications in .NET that provide both a front-end GUI for normal use as well as a command-line interface for other needs (e.g. extending, scheduling, automating, advanced usage, etc). What is the best practice for naming the two executables, since they are built to the same directory? I've seen or done some of the following:

  • Name the GUI <X>.GUI.exe and the console <X>.exe.
  • Name the GUI <X>.exe and the console <X>.Console.exe.
  • Name the GUI <X>g.exe and the console <X>c.exe, or some other name-suffix mixture.
  • Have the code under a descriptive namespace like above but exclude the namespace on the console's executable. Maybe make it a shorter name and all lowercase as well. This is easy to type in a shell, but the common user still sees the complex namespace for the GUI executable.
  • Use different names or namespaces altogether.

There are two distinct interfaces--one graphical, the other textual--to the same common application, but I want the filenames to be clear as to what the program is, while giving a hint (other than just in its icon) to whether it is the GUI or the console, all without using a cryptic name.

Side note: there's a similar "problem" where you have a .NET class library and want to write a front end to use it without writing code. Here, I usually see the executable named <X>.Exe.exe where the library is just called <X>.dll (but I'm not convinced this is good practice), or it is a friendlier name, e.g. Some Tool Name.exe. But in this question, I'm more interested in what to name the executables.

+2  A: 

The way I see it, is that Namespaces are meaningful from a coding perspective and my users probably should not see that, escpecially for a console app, where they are typing it out.

If I had an app where the namespace was something like....

  jarvis.scrabblehelper.gui and 
  jarvis.scrabblehelper.console

then my exe would be

  ScrabbleHelper.exe 

and the console version would be

  sh.exe
Tim Jarvis
A: 

Put them in a single winexe assembly and when you need to run in console attach it following this link.

Parsa
I don't like to downvote, but the link has 3 comments that say that they have problems.. did you try it???
gbianchi
@gbianchi: I've updated the link, and this time I've tested the code (the C# one). Thanks for your notice.
Parsa
(Copied from above) I've actually done this before, and I've found that it can be misleading to the user. For instance, when you run a program with no arguments in a terminal, it usually does a default action or shows the help message, but instead, a GUI opens up. It can be even more confusing if you actually want to accept an argument when running the GUI (e.g. some drag-drop operation of another file). Overall, I figured doing it this way was rare, so I chose not to include it in the question.
Arc