When should I add a GUI?

I write a lot of scripts at home and at work. In most cases, scripts are used only a few times to complete their chosen task, and then are never used again. However, sometimes I write a script to do something more complex that requires user input. It is at this point that I usually torment about whether to use the graphical interface or stick to y / n, press 1-10, etc. command line interface. This type of interface can become tedious to use and difficult to maintain.

I know that some things are more graphical than others, such as choosing things from a giant list. However, the time taken to switch the command-line application to using the graphical interface is prohibitive. It takes me a lot of time to add a GUI using the simplest framework I can find.

I am curious if any developers have a method for determining at what point their script is enough to require a graphical interface. Or am I going to do it wrong, should I write scripts, assuming that I can add a GUI later?

+4
source share
7 answers

As with many questions of this type, the answer is that it depends.

If your program / script does only one thing, getting multiple inputs from the user, it is best to stick to a mode without a GUI.

If the application does more than one, and if you think that the user will use the application to do many things, you can use the graphical interface.

Do you plan to distribute this program to others? Then it is better to provide a graphical interface.

If users are not technical, a graphical user interface is required!

Here it is.

+9
source

This does not answer your question, but the FWIW intermediate step between the UI and the command line is to create a configuration file instead of the user interface file:

  • Edit the configuration file
  • Run the program

The configuration file format can, if necessary, be complex and well commented.

+10
source

If you want to transfer your things to someone else in a way that is accessible to you. Command line scripts are awesome because they are simple and elegant, but they are not very searchable. That is, if you must pass on your scripts to someone else without documentation, will they be able to understand what they are and how to use them? If your tasks are so simple that myscript /? will explain what you need to do completely, then you do not need a graphical interface.

If, on the other hand, you pass on your scripts to someone who is not so technical, or needs more visual guidance on the task to be performed than by all means, the graphical interface is a good way. You might even want to save your scripts as they are, and simply create a separate graphical interface that launches them for maximum flexibility.

+3
source

I think this division also depends on the audience that your script will use: if these are people who are comfortable with the command line, then there is no need to add a graphical interface if your script has good / help that explains all the parameters that he accepts. But if you want the "average user" to be able to use your program, I would prefer to add a graphical interface, because otherwise your program may not be intuitive enough for this group of users.

+2
source

If you only need some Dialogs to enhance your scripts, you can use KDE Kdialog or Gnome Zenity .

+1
source

I can’t count the number of times that I wrote what I thought would be β€œone-time”, and became more useful than I thought, and ended up writing a graphical interface for it, or I need to go back to use the program after a few months. The advantage of the GUI is that it is easier to remember what would otherwise be a command line argument. That is, for flags and options, you can simply use flags, combo boxes, radio buttons and file names. I use Borland C ++ RAD, so it's pretty simple and easy to reset a simple (or even not very simple) dialog box. I now often start by creating a graphical interface.

0
source

If you are using Linux, try Zenity. This is an easy-to-use GUI tool for command line programs.

0
source

All Articles