Hacker News new | past | comments | ask | show | jobs | submit login

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".




Searching for "Delete a file" in the python manual, will take you to a page about the configuration parser.

https://docs.python.org/3/search.html?q=delete+a+file&check_...

Top result: https://docs.python.org/3/library/configparser.html?highligh...

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...


To be fair I have read the Python manual over and over again, I can usually find things by clicking on the appropriate section.


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 think it takes a lot of effort and working memory to ignore the ads and correct the mistakes on sites like spam overflow, spam3school, etc.

If it was was Clojure or some other language that has an awful online manual it is one thing but the Python manual is good.


Spam overflow? Is that stack overflow?

And... I'm guessing w3school?


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.


I agree yet in the article google is criticised for having the official docs as search result 1.

I guess I just want different results to the same query than the author


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.


I wish the python manual was the default search for function references too...


Realpython is a third party site that I'll admit is acceptable for these results.

Mostly yes, you just search efficient documentation.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: