I would love it if instead of quitting my program with an error, it just went ahead and called the method it thinks I'm referring to. This would remove a lot of unneeded friction from web development.
One of the early PL/1 compilers IBM wrote in the 60's did something akin to this. It was a 'premium' feature, available in one of the more expensive compilers. Where it detected any error or wrong looking code, it would correct it. There's a story floating around somewhere on the net of one guy trying to use it... (Which I can't find at the moment.)
The first time he tried to compile with it, he used a program of roughly "Hello from PL/1". When he ran it, he got a division by zero error, because his string had been turned into an arithmetic expression. With the 1 turned into an I, which was then an unitialized variable, which then defaulted to 0.
There is actually a python module that does something like that. It goes to the extreme to keep the program running no matter the error you make, arithmetic error are replaced with random results, missing functions skipped, exceptions silently swallowed etc etc. It is obviously a joke but they could benefit greatly from this feature ;)
For those who are interested, I'm pretty sure this is what you're referring to https://github.com/ajalt/fuckitpy. It's worth looking into for the documentation alone.
FuckIt.py uses state-of-the-art technology to make sure your Python
code runs whether it has any right to or not. Some code has an error? Fuck it.
FuckIt.py uses a combination of dynamic compilation, Abstract Syntax Tree
rewriting, live call stack modification, and love to get rid of all those
pesky errors that make programming so hard.
Still getting errors? Chain fuckit calls. This module is like violence:
if it doesn't work, you just need more of it.
Sounds like the Python equivalent of Visual BASIC's "On Error Resume Next" atrocity.
Except you can find "On Error Resume Next" in "production" code. If I ever consider taking contracts doing Visual Basic, the contract will specify that any occurrence of "On Error Resume Next" automatically doubles my daily rate.
You are correct, but please don't refer to the bastardized version of the Jargon file. Wikipedia has a much better and more accurate article, with actual quotes and citations instead of unsourced politically motivated mythology attributed to "some victims":
>Critics of DWIM claimed that it was "tuned to the particular typing mistakes to which Teitelman was prone, and no others" and called it "Do What Teitelman Means" or "Do What Interlisp Means." - Guy L. Steele Jr., Richard P. Gabriel, "The Evolution of Lisp"
The person who bastardized and maintains the Jargon file is a racist, sexist nut job who built his career on attacking the Free Software movement, and who doesn't deserves anyone's respect or attention: http://rationalwiki.org/wiki/Eric_S._Raymond