From: adrianho@barkley.berkeley.edu (Adrian J Ho)
Newsgroups: comp.lang.tcl
Subject: Re: Object orientedness & The Customer (tm)
Date: 18 Aug 92 22:19:08
Organization: University of California, Berkeley
NNTP-Posting-Host: barkley.berkeley.edu
In-reply-to: david@twg.com's message of 18 Aug 92 17:10:23 GMT

[Disclaimer: I'm by no means an OOP maven, but I'm certainly a very
opinionated user.  Feel free to tell me I don't know what the hell I'm
talking about.  8-)]

In article <1992Aug18.170731.12063@twg.com> david@twg.com (David Herron) writes:
>For this to be of any aid to The Customer they must be able to understand
>whatever language we choose to use.  Throwing an Object and Class paradigm
>into the language seems to raise the amount s/he must learn before being
>able to play with the applications front end.  But that's just `intuition'
>and some user-factors research might prove me wrong.  Especially if it was
>presented well with something to make the class structure obvious.

IMHO, user-factors research sometimes produces results that run
counter to intuition, but this usually happens when the researchers
don't ask the right (read: relevant) questions.  8-)

Seriously though, I think one of the major stumbling blocks towards
the CommonFolk learning OOP as it's commonly presented in the
RealWorld is the counter-intuitive syntax.  Yup, that's right:
*syntax*, not semantics.  The concepts of Objects and Classes aren't
nearly as difficult to understand and master as user surveys might
indicate -- it's more the expression of such ideas in languages like
C++ and Smalltalk that confuse the heck out of PeopleInTheStreet.

Consider how the AveragePerson's thought processes are formulated.
Notice the verb-noun arrangement?  Now count the number of OOPLs can
you think of that present exactly that syntax -- I can't think of any.
All the OOPLs I know use the noun-verb (object-method) syntax, forcing
users to continually reverse their instructions and interrupting their
trains of thought.  Small wonder that OOPLs haven't caught on much at
the user level.

(I should note at this point that I have limited breadth of experience
in OOPLs, so there might indeed be some relatively obscure one that
exhibits verb-noun syntax.  Also, I'm limiting my observation to those
people for whom English is the NativeLanguage -- other languages may
very well be more conducive to thinking in noun-verb style.)

This, incidentally, is one of the reasons why, as David observed:

>TCL/TK has been a breeze to work with

It simply fits the way people are used to thinking -- and,
appropriately enough, it's a tool *command* language.  8-)

So how can we make the OOStyle more acceptable to the GeneralPublic?
Make the language emulate the action-oriented style that we use so
often in daily life.  For example, let the user say "insert davy.jones
in locker" instead of "locker::insert(davy.jones)".  Remember, most of
us are used to doing things to objects, and objects doing things to
themselves is a somewhat bizarre notion.  8-)

To tie this back into the context of Tcl/Tk, I'll regurgitate the
schism between widget commands (".w configure") and other commands
("create .w").  Granted that this seems like a minor point for
proficient programmers, but from personal experience, the former form
automatically starts me thinking "Now what commands does this widget
support?  Is XYZ among them?", while the latter triggers "OK, I wanna
do XYZ; let's do it and see if the widget supports it."  See the
difference?  The first puts the brakes on my programming train of
thought, however momentarily; the latter doesn't, and in fact
stimulates creative juices by encouraging the TryItAndSee approach --
yet another reason why OOPLs haven't taken off as expected.

So how can this be accomplished in Tk?  An easy and elegant way is to
modify the unknown command to simply swap the first two words in a
command if the first word begins with a period.  Voila, "insert
.listbox $index foo bar" becomes legal...and more intuitive.
--
-----------------------------------------------------------------------------
Adrian Ho, He With The Embarrassingly *Dead* Passion ** Phone: (510) 642-5563
System Manager, CFD Lab, ME Dept, UC Berkeley * adrianho@barkley.berkeley.edu
Maintainer, Tcl/Tk Contrib Archive ---- barkley.berkeley.edu [128.32.142.237]
  Send all Tcl/Tk Archive-related stuff to tcl-archive@barkley.berkeley.edu