Hacker News new | ask | show | jobs
by yukinon 1013 days ago
Hot take here, but as someone that doesn't code daily, I prefer those sites over the actual docs in most cases.

If I need to get something done quick, those sites will give me a quick 5 second refresher with clear examples.

Actually, in the doc you described as "obviously the correct hit", all I see is

> str.endswith(suffix[, start[, end]])

> Return True if the string ends with the specified suffix, otherwise return False. suffix can also be a tuple of suffixes to look for. With optional start, test beginning at that position. With optional end, stop comparing at that position.

Meanwhile, the first hit in Google for me is Programiz, which has actual real examples without any additional clicking around or trying to understand how the information is structured.

Besides, I know the docs exist, I don't need a google search for it. I'll click on the content farms every time because they've consistently been the fastest way for me to get what I need.

6 comments

Yeah I enjoy the content farms. Who needs documentation on a simple problems when you can instead have something easy like this:

Many are asking questions about the Python Documentation How To Check Null Python 2023. Here are some solutions to How To Check Null Python 2023:

<ADVERTISEMENT>

Solution 1: Type "if variable is None"

<ADVERTISEMENT>

The first solution out of many is to type "if variable is None". This is the best way to solve Python issues, recommended by experts.

<ADVERTISEMENT>

Solution 2: Download Windows Computer Cleaner

That seems a bit disingenuous on your part. I picked the top 3 hits on Google and they are all very helpful and to the point - Programiz, W3Schools, Tutorialspoint. Granted, I have ublock origin, as most people should have anyway.
This got a chuckle out of me, but plenty of content farms for programming are extraordinarily useful. One could make the case W3schools is a content farm, and that's raised a whole generation of programmers for their knowledge.
> "if variable is None"

Is missing :

We all know we should do the following, it's much clearer.

# Example of a dictionary to check None

> # Assign None to a variable

> myvar = None

> # Declare dictionary to check None

> mydictionary = {None: 'None is stored in this variable'}

> print(mydictionary[myvar])

If I expected something, I would try it.

You don't have adblock?
Every recipe website!
Well, I for one think it's quite kind for them to offer a free computer cleaner! Just let me install it and... 1250 errors?!
And then it deletes your .venv folders to save space!
It's really surprising how awful the official Python docs are, considering how much the language has grown of late. If I need to reference core Python docs these days, I almost always go to this version on devdocs.io[1].

Thankfully most of the reference documentation I have to look up are the popular data science libraries like pandas. Their documentation[2] is so much cleaner than core Python.

1: https://devdocs.io/python~3.11/ 2: https://pandas.pydata.org/docs/reference/index.html#api

Except those farms don't do any original research and just copy off each other. They're littered with mistakes and you will see the same mistake pop up across all of them.

These days for obscure terms, you don't even get the luxury of reading garbage written by people who barely understand the topic at hand, instead you get meaningless fluff generated en masse using LLMs.

Honestly, I'd rather spend time parsing whatever doxygen spits out than try to figure out what the needlessly verbose yet inaccurate LLM output is trying to get at.

> Actually, in the doc you described as "obviously the correct hit", all I see is

>> str.endswith(suffix[, start[, end]])

>> Return True if the string ends with the specified suffix, otherwise return False. suffix can also be a tuple of suffixes to look for. With optional start, test beginning at that position. With optional end, stop comparing at that position.

> Meanwhile, the first hit in Google for me is Programiz, which has actual real examples without any additional clicking around or trying to understand how the information is structured.

I'm sorry, but what examples could you possibly want that the official documentation doesn't make clear? It's written as concisely as can be, describing the possible inputs and the expected outputs of the particular function, no? I don't see how sifting through tens of lines explaining what the docs say in two short sentences is preferable.

I don't know if you're trolling or not.

When you get good at it, it is much easier to skim through 10 lines of fluff to find the answer (that is usually visually distinguished in a code block) then it is to parse through 4 really dense, terminology filled sentences.

If I need to know exactly how all the options work, sure the docs are the place to go, but 90% of the time I just need a quick example to go off of.

I'm not trolling. From my perspective mastering a language includes mastering its included library (for things like python where its standard library is indeed what everyone is using). Thus, it is always preferable to read the complete documentation for some functionality and pick up every detail along the way instead of having an idea in your head how to do the thing you want and picking only the exact use case you wanted from an example.

> If I need to know exactly how all the options work, sure the docs are the place to go, but 90% of the time I just need a quick example to go off of.

You will almost never get to the point where you'd need to know "exactly how all the options work" because if your routine is "search example, copy example, continue", you won't even know what options exist and that there is a way you could do things different (maybe more efficient? simpler?).

Php docs get this right in a way that works for many more people than Python does.
Agreed. For all of the hate PHP gets, the state of their respective docs was a big pain point for me in trying to learn Python after years of writing PHP.

However, the PHP docs, especially for older, less-used functions, are riddled with subtle errors and inconsistencies related to the typing of arguments and handling of edge cases. But the way they're structured is fine! I particularly enjoy how you can type php.net/sprintf and land directly on the doc page you're looking for.

Official python docs are awful. Same with MSDN. Docs should be more than just the auto-generated pydocs which just parrot the function signature—which I can easily infer because I can, you know, read.

For any sufficiently complex function that requires me to actually look up the docs, I want example usage. Not all arguments are obvious. Not all return types are obvious. This is especially bad for overloaded functions. Worse is when docs requires a circular graph traversal of clicking endless links to more documentation.

Needless to say, I prefer content farms and blogs to the official docs.

> I'm sorry, but what examples could you possibly want […]?

Any? Any example would do.

Humans are much better at inferring rules from examples than at deducing an example from a concisely stated rule. The official python docs are the latter.
I get your point for vanilla Python docs. Content farm pages can be more helpful for quick look ups here.

But if you use Pandas, Numpy, Scipy, etc., you know how fantastic the official docs are. They are much better than content farm crap. And, yet, in these cases, too, Google ranks those sites higher.

I use DDG a lot more, and it has almost replaced Google for me.

I use Google now only for local uses- gas stations near me, restaurants near me, and so on.

I also highly encourage you to try code.you.com and phind.com. I have been very happy with them.

> Actually, in the doc you described as "obviously the correct hit", all I see is

> > str.endswith(suffix[, start[, end]])

> > Return True if the string ends with the specified suffix, otherwise return False. suffix can also be a tuple of suffixes to look for. With optional start, test beginning at that position. With optional end, stop comparing at that position.

What exactly don't you understand from that concise and official documentation?

Parent wants a real example not a partial syntax definition
Why not generate a few examples of your own using the REPL?