Mercurial > hg > xemacs-beta
view etc/MOTIVATION @ 853:2b6fa2618f76
[xemacs-hg @ 2002-05-28 08:44:22 by ben]
merge my stderr-proc ws
make-docfile.c: Fix places where we forget to check for EOF.
code-init.el: Don't use CRLF conversion by default on process output. CMD.EXE and
friends work both ways but Cygwin programs don't like the CRs.
code-process.el, multicast.el, process.el: Removed.
Improvements to call-process-internal:
-- allows a buffer to be specified for input and stderr output
-- use it on all systems
-- implement C-g as documented
-- clean up and comment
call-process-region uses new call-process facilities; no temp file.
remove duplicate funs in process.el.
comment exactly how coding systems work and fix various problems.
open-multicast-group now does similar coding-system frobbing to
open-network-stream.
dumped-lisp.el, faces.el, msw-faces.el: Fix some hidden errors due to code not being defined at the right time.
xemacs.mak: Add -DSTRICT.
================================================================
ALLOW SEPARATION OF STDOUT AND STDERR IN PROCESSES
================================================================
Standard output and standard error can be processed separately in
a process. Each can have its own buffer, its own mark in that buffer,
and its filter function. You can specify a separate buffer for stderr
in `start-process' to get things started, or use the new primitives:
set-process-stderr-buffer
process-stderr-buffer
process-stderr-mark
set-process-stderr-filter
process-stderr-filter
Also, process-send-region takes a 4th optional arg, a buffer.
Currently always uses a pipe() under Unix to read the error output.
(#### Would a PTY be better?)
sysdep.h, sysproc.h, unexfreebsd.c, unexsunos4.c, nt.c, emacs.c, callproc.c, symsinit.h, sysdep.c, Makefile.in.in, process-unix.c: Delete callproc.c. Move child_setup() to process-unix.c.
wait_for_termination() now only needed on a few really old systems.
console-msw.h, event-Xt.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.h, process-nt.c, process-unix.c, process.c, process.h, procimpl.h: Rewrite the process methods to handle a separate channel for
error input. Create Lstreams for reading in the error channel.
Many process methods need change. In general the changes are
fairly clear as they involve duplicating what's used for reading
the normal stdout and changing for stderr -- although tedious,
as such changes are required throughout the entire process code.
Rewrote the code that reads process output to do two loops, one
for stdout and one for stderr.
gpmevent.c, tooltalk.c: set_process_filter takes an argument for stderr.
================================================================
NEW ERROR-TRAPPING MECHANISM
================================================================
Totally rewrite error trapping code to be unified and support more
features. Basic function is call_trapping_problems(), which lets
you specify, by means of flags, what sorts of problems you want
trapped. these can include
-- quit
-- errors
-- throws past the function
-- creation of "display objects" (e.g. buffers)
-- deletion of already-existing "display objects" (e.g. buffers)
-- modification of already-existing buffers
-- entering the debugger
-- gc
-- errors->warnings (ala suspended errors)
etc. All other error funs rewritten in terms of this one.
Various older mechanisms removed or rewritten.
window.c, insdel.c, console.c, buffer.c, device.c, frame.c: When creating a display object, added call to
note_object_created(), for use with trapping_problems mechanism.
When deleting, call check_allowed_operation() and note_object
deleted().
The trapping-problems code records the objects created since the
call-trapping-problems began. Those objects can be deleted, but
none others (i.e. previously existing ones).
bytecode.c, cmdloop.c: internal_catch takes another arg.
eval.c: Add long comments describing the "five lists" used to maintain
state (backtrace, gcpro, specbind, etc.) in the Lisp engine.
backtrace.h, eval.c: Implement trapping-problems mechanism, eliminate old mechanisms or
redo in terms of new one.
frame.c, gutter.c: Flush out the concept of "critical display section", defined by
the in_display() var. Use an internal_bind() to get it reset,
rather than just doing it at end, because there may be a non-local
exit.
event-msw.c, event-stream.c, console-msw.h, device.c, dialog-msw.c, frame.c, frame.h, intl.c, toolbar.c, menubar-msw.c, redisplay.c, alloc.c, menubar-x.c: Make use of new trapping-errors stuff and rewrite code based on
old mechanisms.
glyphs-widget.c, redisplay.h: Protect calling Lisp in redisplay.
insdel.c: Protect hooks against deleting existing buffers.
frame-msw.c: Use EQ, not EQUAL in hash tables whose keys are just numbers.
Otherwise we run into stickiness in redisplay because
internal_equal() can QUIT.
================================================================
SIGNAL, C-G CHANGES
================================================================
Here we change the way that C-g interacts with event reading. The
idea is that a C-g occurring while we're reading a user event
should be read as C-g, but elsewhere should be a QUIT. The former
code did all sorts of bizarreness -- requiring that no QUIT occurs
anywhere in event-reading code (impossible to enforce given the
stuff called or Lisp code invoked), and having some weird system
involving enqueue/dequeue of a C-g and interaction with Vquit_flag
-- and it didn't work.
Now, we simply enclose all code where we want C-g read as an event
with {begin/end}_dont_check_for_quit(). This completely turns off
the mechanism that checks (and may remove or alter) C-g in the
read-ahead queues, so we just get the C-g normal.
Signal.c documents this very carefully.
cmdloop.c: Correct use of dont_check_for_quit to new scheme, remove old
out-of-date comments.
event-stream.c: Fix C-g handling to actually work.
device-x.c: Disable quit checking when err out.
signal.c: Cleanup. Add large descriptive comment.
process-unix.c, process-nt.c, sysdep.c: Use QUIT instead of REALLY_QUIT.
It's not necessary to use REALLY_QUIT and just confuses the issue.
lisp.h: Comment quit handlers.
================================================================
CONS CHANGES
================================================================
free_cons() now takes a Lisp_Object not the result of XCONS().
car and cdr have been renamed so that they don't get used directly;
go through XCAR(), XCDR() instead.
alloc.c, dired.c, editfns.c, emodules.c, fns.c, glyphs-msw.c, glyphs-x.c, glyphs.c, keymap.c, minibuf.c, search.c, eval.c, lread.c, lisp.h: Correct free_cons calling convention: now takes Lisp_Object,
not Lisp_Cons
chartab.c: Eliminate direct use of ->car, ->cdr, should be black box.
callint.c: Rewrote using EXTERNAL_LIST_LOOP to avoid use of Lisp_Cons.
================================================================
USE INTERNAL-BIND-*
================================================================
eval.c: Cleanups of these funs.
alloc.c, fileio.c, undo.c, specifier.c, text.c, profile.c, lread.c, redisplay.c, menubar-x.c, macros.c: Rewrote to use internal_bind_int() and internal_bind_lisp_object()
in place of whatever varied and cumbersome mechanisms were
formerly there.
================================================================
SPECBIND SANITY
================================================================
backtrace.h: - Improved comments
backtrace.h, bytecode.c, eval.c: Add new mechanism check_specbind_stack_sanity() for sanity
checking code each time the catchlist or specbind stack change.
Removed older prototype of same mechanism.
================================================================
MISC
================================================================
lisp.h, insdel.c, window.c, device.c, console.c, buffer.c: Fleshed out authorship.
device-msw.c: Correct bad Unicode-ization.
print.c: Be more careful when not initialized or in fatal error handling.
search.c: Eliminate running_asynch_code, an FSF holdover.
alloc.c: Added comments about gc-cons-threshold.
dialog-x.c: Use begin_gc_forbidden() around code to build up a widget value
tree, like in menubar-x.c.
gui.c: Use Qunbound not Qnil as the default for
gethash.
lisp-disunion.h, lisp-union.h: Added warnings on use of VOID_TO_LISP().
lisp.h: Use ERROR_CHECK_STRUCTURES to turn on
ERROR_CHECK_TRAPPING_PROBLEMS and ERROR_CHECK_TYPECHECK
lisp.h: Add assert_with_message.
lisp.h: Add macros for gcproing entire arrays. (You could do this before
but it required manual twiddling the gcpro structure.)
lisp.h: Add prototypes for new functions defined elsewhere.
author | ben |
---|---|
date | Tue, 28 May 2002 08:45:36 +0000 |
parents | 3ecd8885ac67 |
children |
line wrap: on
line source
STUDIES FIND REWARD OFTEN NO MOTIVATOR Creativity and intrinsic interest diminish if task is done for gain By Alfie Kohn Special to the Boston Globe [reprinted with permission of the author from the Monday 19 January 1987 Boston Globe] In the laboratory, rats get Rice Krispies. In the classroom the top students get A's, and in the factory or office the best workers get raises. It's an article of faith for most of us that rewards promote better performance. But a growing body of research suggests that this law is not nearly as ironclad as was once thought. Psychologists have been finding that rewards can lower performance levels, especially when the performance involves creativity. A related series of studies shows that intrinsic interest in a task - the sense that something is worth doing for its own sake - typically declines when someone is rewarded for doing it. If a reward - money, awards, praise, or winning a contest - comes to be seen as the reason one is engaging in an activity, that activity will be viewed as less enjoyable in its own right. With the exception of some behaviorists who doubt the very existence of intrinsic motivation, these conclusions are now widely accepted among psychologists. Taken together, they suggest we may unwittingly be squelching interest and discouraging innovation among workers, students and artists. The recognition that rewards can have counter-productive effects is based on a variety of studies, which have come up with such findings as these: Young children who are rewarded for drawing are less likely to draw on their own that are children who draw just for the fun of it. Teenagers offered rewards for playing word games enjoy the games less and do not do as well as those who play with no rewards. Employees who are praised for meeting a manager's expectations suffer a drop in motivation. Much of the research on creativity and motivation has been performed by Theresa Amabile, associate professor of psychology at Brandeis University. In a paper published early last year on her most recent study, she reported on experiments involving elementary school and college students. Both groups were asked to make "silly" collages. The young children were also asked to invent stories. The least-creative projects, as rated by several teachers, were done by those students who had contracted for rewards. "It may be that commissioned work will, in general, be less creative than work that is done out of pure interest," Amabile said. In 1985, Amabile asked 72 creative writers at Brandeis and at Boston University to write poetry. Some students then were given a list of extrinsic (external) reasons for writing, such as impressing teachers, making money and getting into graduate school, and were asked to think about their own writing with respect to these reasons. Others were given a list of intrinsic reasons: the enjoyment of playing with words, satisfaction from self-expression, and so forth. A third group was not given any list. All were then asked to do more writing. The results were clear. Students given the extrinsic reasons not only wrote less creatively than the others, as judged by 12 independent poets, but the quality of their work dropped significantly. Rewards, Amabile says, have this destructive effect primarily with creative tasks, including higher-level problem-solving. "The more complex the activity, the more it's hurt by extrinsic reward," she said. But other research shows that artists are by no means the only ones affected. In one study, girls in the fifth and sixth grades tutored younger children much less effectively if they were promised free movie tickets for teaching well. The study, by James Gabarino, now president of Chicago's Erikson Institute for Advanced Studies in Child Development, showed that tutors working for the reward took longer to communicate ideas, got frustrated more easily, and did a poorer job in the end than those who were not rewarded. Such findings call into question the widespread belief that money is an effective and even necessary way to motivate people. They also challenge the behaviorist assumption that any activity is more likely to occur if it is rewarded. Amabile says her research "definitely refutes the notion that creativity can be operantly conditioned." But Kenneth McGraw, associate professor of psychology at the University of Mississippi, cautions that this does not mean behaviorism itself has been invalidated. "The basic principles of reinforcement and rewards certainly work, but in a restricted context" - restricted, that is, to tasks that are not especially interesting. Researchers offer several explanations for their surprising findings about rewards and performance. First, rewards encourage people to focus narrowly on a task, to do it as quickly as possible and to take few risks. "If they feel that 'this is something I have to get through to get the prize,' they're going to be less creative," Amabile said. Second, people come to see themselves as being controlled by the reward. They feel less autonomous, and this may interfere with performance. "To the extent one's experience of being self-determined is limited," said Richard Ryan, associate psychology professor at the University of Rochester, "one's creativity will be reduced as well." Finally, extrinsic rewards can erode intrinsic interest. People who see themselves as working for money, approval or competitive success find their tasks less pleasurable, and therefore do not do them as well. The last explanation reflects 15 years of work by Ryan's mentor at the University of Rochester, Edward Deci. In 1971, Deci showed that "money may work to buy off one's intrinsic motivation for an activity" on a long-term basis. Ten years later, Deci and his colleagues demonstrated that trying to best others has the same effect. Students who competed to solve a puzzle quickly were less likely than those who were not competing to keep working at it once the experiment was over. Control plays role There is general agreement, however, that not all rewards have the same effect. Offering a flat fee for participating in an experiment - similar to an hourly wage in the workplace - usually does not reduce intrinsic motivation. It is only when the rewards are based on performing a given task or doing a good job at it - analogous to piece-rate payment and bonuses, respectively - that the problem develops. The key, then, lies in how a reward is experienced. If we come to view ourselves as working to get something, we will no longer find that activity worth doing in its own right. There is an old joke that nicely illustrates the principle. An elderly man, harassed by the taunts of neighborhood children, finally devises a scheme. He offered to pay each child a dollar if they would all return Tuesday and yell their insults again. They did so eagerly and received the money, but he told them he could only pay 25 cents on Wednesday. When they returned, insulted him again and collected their quarters, he informed them that Thursday's rate would be just a penny. "Forget it," they said - and never taunted him again. Means to and end In a 1982 study, Stanford psychologist Mark L. Lepper showed that any task, no matter how enjoyable it once seemed, would be devalued if it were presented as a means rather than an end. He told a group of preschoolers they could not engage in one activity they liked until they first took part in another. Although they had enjoyed both activities equally, the children came to dislike the task that was a prerequisite for the other. It should not be surprising that when verbal feedback is experienced as controlling, the effect on motivation can be similar to that of payment. In a study of corporate employees, Ryan found that those who were told, "Good, you're doing as you /should/" were "significantly less intrinsically motivated than those who received feedback informationally." There's a difference, Ryan says, between saying, "I'm giving you this reward because I recognize the value of your work" and "You're getting this reward because you've lived up to my standards." A different but related set of problems exists in the case of creativity. Artists must make a living, of course, but Amabile emphasizes that "the negative impact on creativity of working for rewards can be minimized" by playing down the significance of these rewards and trying not to use them in a controlling way. Creative work, the research suggests, cannot be forced, but only allowed to happen. /Alfie Kohn, a Cambridge, MA writer, is the author of "No Contest: The Case Against Competition," recently published by Houghton Mifflin Co., Boston, MA. ISBN 0-395-39387-6. /