[comp.lang.c] The Principle of Most Astonishment

dhesi@bsu-cs.UUCP (Rahul Dhesi) (08/19/87)

In article <14039@topaz.rutgers.edu> ron@topaz.rutgers.edu (Ron Natalie) writes:
[continuing a discussion about reasonable defaults]
>The default action for the compiler should be to ACT NORMALLY.  ACTING
>NORMALLY means complying with whatever standards might be there.

The VAX/VMS C compiler gives you a choice of warning you against non-
portable constructs or accepting them silently.  The command-line
switch used for this is /STANDARD, and optionally you can add the 
string =NO or =YES after it.

The fun part is this.

If you invoke it as CC it accepts non-portable constructs silently.

If you invoke it as CC /STANDARD it still accepts non-portable
constructs silently.  The compiler assumes that users who type
/STANDARD really meant /STANDARD=NO.

This is the Principle of Most Astonishment at its best.

Consider its potential universal application.  If you typed LOGOUT, you
really meant LOGOUT=NO, so you stay logged in...Experienced users might
tear out their hair, but it would greatly help novice users who often
log out accidentally.  :-)
-- 
Rahul Dhesi         UUCP:  {ihnp4,seismo}!{iuvax,pur-ee}!bsu-cs!dhesi

barmar@think.COM (Barry Margolin) (08/20/87)

In article <996@bsu-cs.UUCP> dhesi@bsu-cs.UUCP (Rahul Dhesi) writes:
>Consider its potential universal application.  If you typed LOGOUT, you
>really meant LOGOUT=NO, so you stay logged in...

Remember, this is DEC you're talking about.  They're the people who
brought us the PDP-10, on which the "JUMP ADDRESS" instruction doesn't
jump anywhere.  There is an optional parameter before the address that
specifies the condition code that must be set to cause the jump, and
if you don't specify any then it jump under no circumstances.

---
Barry Margolin
Thinking Machines Corp.

barmar@think.com
seismo!think!barmar