Had another 48hr game jam this weekend...
H. S. Teoh
hsteoh at quickfur.ath.cx
Mon Sep 2 22:39:34 PDT 2013
On Mon, Sep 02, 2013 at 02:04:22PM -0700, Walter Bright wrote:
> On 9/2/2013 1:36 PM, H. S. Teoh wrote:
> >It's things like this "keyhole interface", that caused me to be
> >convinced that the GUI emperor has no clothes, and to turn to
> >CLI-only development.
>
> One of the giant failures of the GUI interface, and that VS suffers
> from, too, is when you need to do repetitive operations.
>
> On the CLI, I constantly use the history list, and I constantly
> write throwaway scripts to automate what I'm doing at the moment. It
> makes everything I do, no matter how obscure, only 2 or 3
> keypresses.
Some GUI apps do have macro facilities. The problem is, *most* GUI apps
don't, and those that do brew their own and do it their own
idiosyncratic way. Which means it only works *within* the app. You'd be
lucky enough to *have* macro facilities in the first place, and now you
want to interface with an external app? Tough luck. Some macro
facilities do allow interfacing with CLI scripts and stuff, but wanna
interface with another GUI app? Not a chance. Any inter-app scripted
interface only exists if it's anticipated by the developers (and they
have enough financial/political backing to implement it). And that's
precisely the problem. You *can't* anticipate everything that users
might need to do. So most inter-app scripting is basically impossible.
As someone once said, a good software design makes easy things easy, and
hard things possible. With (most) GUI apps, easy things are indeed easy,
but hard things are impossible.
Now I'm not saying CLI apps are necessarily better in terms of UI design
-- a lot of CLI utilities are unnecessarily obscure (I mean, "awk",
"grep", "sed"? In this day and age? Seriously?). So they flunk in the
easy things are easy category. But at least hard things are *possible*.
There's always a way to work around the limitations and get things to
work, even if it's an ugly hack -- the important thing is that it *can*
be made to work somehow. With GUI apps, trying to do something the
developers haven't thought of is an exercise in futility (and
frustration). Given the choice, I rather spend the effort to learn the
"harder" CLI interface, knowing that there will always be a way to make
it work, than to get locked in to a GUI interface whose limitations may
have *no* workarounds.
[...]
> I scan a lot of photos. I have a GUI photo editor. A common thing I
> do is straighten the photos, because they never go through the
> scanner straight. So it's:
>
> right shift click on the picture
> select open with
> select photoeditor
> select edit
> select rotate
> select autorotate
> select apply
> select save
> select exit
>
> Sounds easy, right? It is easy. Now do it to 1000 photos. With a
> command line tool:
>
> write a script that does it to one picture, name it cc.bat
>
> do:
> dir/b *.jpg >doit.bat
>
> open the file and use the macro feature to prepend "cc " to each
> file name, maybe 10 keystrokes
>
> execute the script
>
> Done! And CLI Clint goes and surfs the n.g. while GUI Gus has just
> gotten to picture 4, only 996 more to go!
Yeah, when it comes to image editing, it's imagemagick FTW.
Even for image *generation*, I opt for programmatic generation where
possible. For example, I have a website with lots of geometric images,
all hand-tuned carefully. But the tuning all goes in a script. The build
system runs the script through a program that does the calculations and
outputs PovRay scene files, povray transforms them into .png's, then the
build script runs imagemagick on them to trim them down, add borders,
etc., and then install them into the right target directories. As a
result, none of the images need to be backed up; the subversion repos
contains only the text-based script files. If needed, a single command
recreates the entire website, images and all, completely automatically.
Furthermore, I've often found the need to tweak the images from time to
time. For example, adjust the colors on a particular geometric object to
make it brighter, etc.. Or if there's a mistake in the source data, and
a whole set of images need to be re-rendered. Had I done all the images
by hand, it would be a positively painful process of manually examining
each image, load it up in the image editor and painstakingly adjust the
one tiny part that needs adjusting, and miss the 20 other images that
also need to be adjusted, etc.. But with my fully-scripted system, I
just edit a couple of values in the source data files, and *all* the
images downstream get regenerated automatically by the build system
(which, unlike makefiles, uses content-hashing to determine which
targets need to be rebuilt, so it automatically knows exactly which
files to refresh). A single command, and everything that needs to be
updated is re-rendered and regenerated, and optionally, published.
Best of all, this lets me work on an in-progress version of the website
on my local PC and see exactly how it's gonna look, then when it's
ready, logon to the webserver, svn update, scons -j12 install, and sit
back and take a break, and let the script do its job, knowing that a
couple o' hours later the website will automatically be updated. No
babysitting necessary.
Had I used GUI tools to do this, I'd be fighting with trying to make
ImageEditorPro123 work with VisualWebsite2013, and trying to remember
which folders held which version of which image, forgetting which layers
to apply in which order to which image, generating images from the wrong
version of the source data and having to redo it all, etc.. It'd be a
gigantic exercise in micromanagement just to get things to work together
properly. The lack of cross-app scriptability really turns this into a
full-time job, whereas right now, it's a 5-minute edit and re-run the
build script, and I'm up and away.
Sometimes I wonder how we managed to get from intelligent parsing of
language (CLI commands with meaningful syntax!) all the way to the
advanced caveman future of point-and-grunt.
T
--
They say that "guns don't kill people, people kill people." Well I think
the gun helps. If you just stood there and yelled BANG, I don't think
you'd kill too many people. -- Eddie Izzard, Dressed to Kill
More information about the Digitalmars-d
mailing list