Graphical = good and command line = bad?
Posted by isilanes on January 15, 2008
It is not uncommon to hear (mostly from Windows users berating Linux and its “useless console”) that one of the benefits of Windows is that everything can be done through a GUI. After all, clicking on icons and finding stuff in menus is more intuitive, and everything is easier that way. In contrast, with Linux you have to “type an awful lot of things, which is boring, slow, and difficult. And ugly”.
Now, don’t get me wrong, GUIs are great. I quite like them. What annoys me is the lack of command-line interface for some tasks. Both GUIs and CLIs have their place in computer use, and the wise should use each when appropriate. In this post I will try to illustrate a case where the automation allowed by using the CLI and some scripting is largely missed. The user (me) is forced to use an “intuitive” GUI, with the result that my patience takes a direct hit below the flotation line.
The following YouTube video, made by myself, shows the process of plotting 2 orbitals (I had to plot 17). Notice that, due to the program running so slow, the process takes around 1 minute per orbital!
Notice also that all the previous work has been done: choosing the colors of the background, atoms and orbitals, choosing the orientation, opening the atomic geometry… The comprehensive list of what to do for each orbital follows, with each line preceded by the point in time (seconds) when it happens:
- 00.00 – Click on “Delete surface” to remove previous orbital
- 07.80 – Click on “Load” to load a new orbital
- 12.67 – Choose a file from the dialog window, and click on “Accept” to load it
- 30.27 – Click on “Both signs”, because we want both positive and negative part of the orbital
- 31.33 – Introduce a value for the isosurface (0.05) in the “cutoff” box
- 33.13 – Click on “Create surface” to have Molekel render the isosurface
- 37.33 – Isosurface appears
- 37.93 – From a drop-down menu (called with right-click of the mouse), choose Snapshot -> RGB
- 52.66 – “Save as” dialog box appears
- 62.73 – Introduce filename for snapshot, and click “Accept”
- 65.00 – We’re done, and can repeat the process for the next orbital
One can’t help but notice that 65 seconds are needed to make eight clicks and introduce a short text in two boxes! The issue is that human attention is necessary during the whole 65 seconds, because the time between actions is too short to do something else in between (although long enough to get on your nerves, like the full 15 seconds to have the “Save as” dialog appear).
Another obvious point is that from the two short texts introduced by the user, one (the value of the isosurface) is always the same, and only the other (the name of the file to save the snapshot as) varies. Also, only one click of the 8 we do is ever different (the choice of orbital file to read). It would be nice to have a robot do this task, the only data we would have to feed it being a list of orbitals (to read, and then to save a snapshot). But we can’t. We are stuck with this sluggish process!
In contrast, I will next show a case where some automation was made. The process is that of cropping the snapshots taken in the previous step (the Molekel thing). Sure, we could use GIMP, or some other GUI tool, but applying exactly the same process to a list of 17 images (and this is a short list, it could have been 1000) is the kind of thing that cringes for automation.
The following video shows the process:
Recall that it takes 4 minutes to process ALL the images. This may not sound like a huge improvement over the 18:25 that it (in principle) took the process above (17 x 65 sec). However, the time spent with Molekel scales linearly with the number of orbitals. 100 orbitals would need almost 2h. The automated cropping process would have taken more than 4 minutes, but only slightly more: maybe 5 or 6.
Also notice that the 4 minutes are full of decisions, and there is no repetitive, unnecessary task (except the fact of committing errors). Let’s take a look at the actions taken during the 4 minutes:
- 00:11.00 – Open a Perl script I had half-done (another benefit of automation: you can reuse old stuff)
- 00:17.87 – Shade window to take a look at the number and name of files to process
- 00:21.33 – Change script accordingly
- 00:47.93 – Save changes
- 00:51.60 – Back to the CLI, and run the script
- 00:55.00 – Ups, nothing happened!
- 00:58.27 – Reopen the script, and look for the error
- 01:05.53 – Found it. Fix it.
- 01:07.33 – Save and execute
- 01:06.87 – It works!
- 01:13.00 – Finished running (0.36 sec per picture)
- 01:21.73 – Open a cropped image in viewer
- 01:22.93 – Realized the crop is wrong!
- 01:30.73 – Alt-Tab to script file, to modify it
- 01:55.67 – Save and execute again
- 02:11.73 – Open the cropped images. The first one seems to be OK!
- 02:29.80 – We reach one that is wrong
- 02:34.20 – Back to the script, and fix it
- 02:45.07 – Save, and back to CLI to re-run
- 02:53.00 – Reopen in image viewer
- 02:56.00 – Cropped part is not centered!
- 03:02.00 – Back to the script, and fix it
- 03:12.33 – Save and re-run
- 03:19.73 – Reopen in image viewer
- 03:27.87 – Yet another error: an image could have been cropped more, to hide an unwanted part
- 03:32.40 – Back to the script
- 03:40.80 – Rerun
- 03:47.13 – Reopen images
- 03:59.93 – See that all of them are correct. Stop and rest
Recall also that if I were to repeat both processes tomorrow, the image cropping would simply require to run the script again (0.36 seconds per image, and you can do something else in between, if you have 1000 images and don’t want to waste time waiting). The creation of the orbitals, on the other hand, would require to repeat the whole process again!! (65 seconds per orbital, plus you have to spend that time paying attention to the process. You can not run something and go away). And the whole problem with the creation of the orbitals is that there is no command-line way of doing it, to be able to automate it.
This entry was posted on January 15, 2008 at 8:46 pm and is filed under Free software and related beasts. Tagged: about me, automation, boring, command line, en, floss/linux, gui, Software. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.