5 ms·
This reminds me of my favourite SO answer: https://stackoverflow.com/a/40429822/864112 https://stackoverflow.com/a/40429822/864112 It boggles the mind that an
by maest 5y ago
This reminds me of my favourite SO answer:
https://stackoverflow.com/a/40429822/864112 https://stackoverflow.com/a/40429822/864112
It boggles the mind that anyone could ever suggest this as a solution.
- deleted 5y ago[deleted]
- kortex 5y agoEw. Yikes. Wow, that's a special kind of special. The mind truly boggles. It had a score of 4 when I first checked it, but it looks like it got slashdotted by this thread/link and now it's -1 and probably still falling. Good.
- esnard 5y agoAt the time I'm writing this, the answer got 3 upvotes, 13 downvotes and 1 delete vote since the link has been posted: https://stackoverflow.com/posts/40429822/timeline?filter=WithVoteSummaries https://stackoverflow.com/posts/40429822/timeline?filter=Wit...
- kortex 5y agoTIL: that timeline feature is really neat! I don't see a way to get to it from the mobile UI though, will need to hunt around.
- arduinomancer 5y agoI'm going to choose to believe that is a joke answer
- klyrs 5y agoWow. Nice comment... > This is akin to answering "how do I bake a cake?" with "open up a bakery, walk inside, and ask for a cake" Only it's more like answering "how much does this cake cost" by purchasing the cake and looking at the receipt.
- TillE 5y agoNerds love terrible analogies for some reason, yours is much better.
- klyrs 5y agoAn analogy is a high-level abstraction of one domain, projected onto a different domain. Of course nerds love them. Or should I say... analogies are like Uber, but for metaphors. No. I should stop before writing that.
- cjonas 5y agoupvoted
- Supermancho 5y agoI'm intrigued, why? I find multiple places where this is the most basic implementation. https://realpython.com/python-requests/#query-string-parameters https://realpython.com/python-requests/#query-string-paramet... https://www.geeksforgeeks.org/get-post-requests-using-python/ https://www.geeksforgeeks.org/get-post-requests-using-python... etc
- pwdisswordfish8 5y agoYour parent poster makes the mistake that is rife among Python programmers, which is to assume that in a delightfully simple[0] language like Python, it's "obvious" what a given piece of code does even without explanation. Among people who don't delight in the poor taste of Python's design and have limited exposure to its standard library, of course, it's not always obvious what a given piece of code is doing despite the belief to the contrary, so there are plenty of people who aren't going to pick up on the fact that requests.get doesn't just construct a GET request for the caller, but instead constructs such a request and then goes out and performs it, too. Shame about the hostile reaction from others towards your question. Keep asking questions (especially things that are presented without comment), and don't be afraid that doing so will make you look stupid or that you should feel like you should be punished for it. 0. https://blog.imgur.com/wp-content/uploads/2017/06/mocking.jpeg https://blog.imgur.com/wp-content/uploads/2017/06/mocking.jp...
- JadeNB 5y ago> Shame about the hostile reaction from others towards your question. I agree that your parent is a good question that should have been well received, but, as far as I can tell, it was. Where do you see a hostile reaction? In fact the only hostility I see in this thread is what you directed at Python, which, in this context, seems unmotivated; it is surely true that one can write code in any language whose full import isn't immediately apparent. At the moment, the only other response to your parent is from hvdijk, saying (https://news.ycombinator.com/item?id=27534803 https://news.ycombinator.com/item?id=27534803): > The question was how to build a URL, not how to send off a request to it. The answer sends off a request and then inspects the response to see what URL was used. If you wanted to send off the request, inspecting the URL on the result is probably not useful. If you didn't want to send off the request, doing it this was is wasteful or even harmful. This seems like a response that takes the question seriously and addresses it clearly, just as it should.
- nl 5y agoYou'd think that is so completely wrong that no competent programmer would ever do it... Except the java.net.URL.equals and java.net.URL.hashcode methods do almost the same thing: they issue DNS requests (!) "Two hosts are considered equivalent if both host names can be resolved into the same IP addresses; else if either host name can't be resolved, the host names must be equal without regard to case; or both host names equal to null." See https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/net/URL.html#equals(java.lang.Object) https://docs.oracle.com/en/java/javase/11/docs/api/java.base... There is a bug raised[1], but it can't be fixed for backwards compatibility reasons. I'll never forget this now, after debugging a very horrible and severe and very intermittent performance issue in some code over 20 years ago. A (slow) DNS resolver occasionally caused 1000x performance degradation on remote sites. That was horrible to work out. [1] https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4434494 https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4434494