For Python programming I would say 100% of the time you should look the answer up in the official manual for a well-defined problem (delete a file) because the manual is correct, well-written, etc. It's astonishing how often Google and Bing snatch defeat from the jaws of victory on queries like this.
If you go looking in splogs, spam overflow and other spam sites at best you are going to get wrong answers, at worse you will get answers that "aren't even wrong".
Top 4 result is "Miscellaneous operating system interfaces", which does hold the answer, but it is not obvious, and browsing through that page is quite a chore before you finally get to `os.remove`, which says that it deletes "a path", which even I, a seasoned developer need to look twice to make sure that path removing a path and a file is the same thing.
https://docs.python.org/3/library/os.html?highlight=delete%2...
I get so annoyed that geeks for geeks is the default thing for so many things I search for in python. Really, it would be far more useful to just bring up the python docs most of the time.
>because the manual is correct, well-written, etc.
It's also verbose and requires effort and working memory to parse, when I could get a trivial one line answer or code snippet from a stackoverflow post specific to my question. Yes, in an ideal world we would all read the manual, but unfortunately manuals are inconvenient. And in my experience the vast majority of stackoverflow answers are correct.
I haven't coded python in a while, but does the python manual follow the man pages style of listing every possible parameter including the weird deprecated options that haven't been used since 1998 before actually providing information and examples of typical usage and instructions on how to handle the common use-cases?
Because that's the software equivalent to recipe spam.
Of the three code related searches in the original blog post, only one Google example listed the official Python documentation as the first link. In the other two examples, the sites shown where:
- W3 Schools
- StackOverflow
I will definitely agree with you that the author seems to want very different things from their search results than we might though. I will always always prefer the official docs (which I can pick through) when I make as vague a search as "<language> throw exception". If I wanted to know "how do I <verb> <noun> in <language>", then that's what I'd Google.
If you go looking in splogs, spam overflow and other spam sites at best you are going to get wrong answers, at worse you will get answers that "aren't even wrong".