3 ms·
edit: fixed formatting problem > sentinel values Using in-band signaling always involves the risk of misinterpreting types. > This is part of more general pr
by pdkl95 6y ago
edit: fixed formatting problem
> sentinel values
Using in-band signaling always involves the risk of misinterpreting types.
> This is part of more general problem
DWIM ("Do What I Mean") was a terrible way to handle typos and spelling errors when Warren Teitelman tried it at Xerox PARC[1] over 50 years ago. From[2]:
>> In one notorious incident, Warren added a DWIM feature to the command interpreter used at Xerox PARC. One day another hacker there typed
delete *$
>> to free up some disk space. (The editor there named backup files by appending $ to the original file name, so he was trying to delete any backup files left over from old editing sessions.) It happened that there weren't any editor backup files, so DWIM helpfully reported
*$ not found, assuming you meant 'delete *'
>> [...] The disgruntled victim later said he had been sorely tempted to go to Warren's office, tie Warren down in his chair in front of his workstation, and then type 'delete *$' twice.
Trying to "automagically" interpret or fix input is always a terrible idea because you cannot discover the actual intent of an author from the text they wrote. In literary criticism they call this problem "Death of the Author"[3].
[1] https://en.wikipedia.org/wiki/DWIM https://en.wikipedia.org/wiki/DWIM
[2] http://www.catb.org/jargon/html/D/DWIM.html http://www.catb.org/jargon/html/D/DWIM.html
[3] https://tvtropes.org/pmwiki/pmwiki.php/Main/DeathOfTheAuthor https://tvtropes.org/pmwiki/pmwiki.php/Main/DeathOfTheAuthor
- wnoise 6y agoEh. "Death of the Author" is a reaction to the text not being dispositive as to what the author meant. It's deciding you don't care what the author meant, no longer considering it a problem that the text doesn't reveal that. Instead the text means whatever you can argue it means. Which can be a fun game, but is ultimately pointless.
- BlueTemplar 6y agoIt gets more complicated when the author himself changes their mind about that.
- lisper 6y ago>> [...] The disgruntled victim later said he had been sorely tempted to go to Warren's office, tie Warren down in his chair in front of his workstation, and then type 'delete $' twice. Ironically, this did not render the way you intended because HN interpreted the asterisk as an emphasis marker in this line. It works here: ... type 'delete *$' twice. because the line is indented and so renders as code, but not here: > ... type 'delete $' twice. because the subsequent line has emphasized text*. So the scoping of the asterisks is all screwed up.