8 ms·
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
by brvs 12y ago
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.
- rurounijones 12y agoBaaad idea, hides the errors and you have no idea if it will call the correct thing in the future too.
- ZoF 12y agoAgreed with this.
- deleted 12y ago[deleted]
- Too 12y agoThere 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 ;)
- rectangletangle 12y agoFor those who are interested, I'm pretty sure this is what you're referring to https://github.com/ajalt/fuckitpy https://github.com/ajalt/fuckitpy. It's worth looking into for the documentation alone.
- Too 12y agoYES! Thank you 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.
- vidarh 12y agoSounds 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.
- rco8786 12y agoThat would be hideously bad
- zenlikethat 12y agoYou should implement a `yolo` gem to support this.
- rurounijones 12y agoWelp, next april fools day gem idea reserved!
- Widdershin 12y agohttps://github.com/markburns/fuzzy https://github.com/markburns/fuzzy
- slavik81 12y agoThat has been tried before. Results were... poor. http://www.catb.org/~esr/jargon/html/D/DWIM.html http://www.catb.org/~esr/jargon/html/D/DWIM.html
- DonHopkins 12y agoYou 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": https://en.wikipedia.org/wiki/DWIM https://en.wikipedia.org/wiki/DWIM >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 http://rationalwiki.org/wiki/Eric_S._Raymond
- negativeview 12y agoThat... makes me very sad. I remember the old ESR. Knew that I hadn't heard of him in a long time, did not know he went a bit nutty...
- modarts 12y agoI'm pretty sure this line of thinking led to us having horribly misguided features like ASI (automatic semicolon insertion) in javascript today
- ASneakyFox 12y agoExcept for in for loops semicolons don't really do anything though. The job of the semicolon could easily be replaced by just a white space character.
- ajuc 12y agoSo, you want programming to be more like writing html in the Quirks Era
- vidarh 12y agoThe person taking over your projects when you move on would put a bounty on your head if you were to do that.
- mattgreenrocks 12y agoAh, the mentality of the web: "I don't have time to get it right, just keep spewing code!"
- Widdershin 12y agoThis gem does just that: https://github.com/markburns/fuzzy https://github.com/markburns/fuzzy
- Solarsail 12y agoOne 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.
- Shervanator 12y agoJust for you! https://github.com/Shervanator/feeling_lucky https://github.com/Shervanator/feeling_lucky
- MrBra 12y agoHaha, loving the description :)