News for hackers. Stuff that matters.
Re:Discord Is Not Documentation by dageshi on Sunday July 16, 2023 @03:17PM (#36750492)
It doesn't seem like python.org answers the question very well? As in the implied question of "What is python __init__?"

The returned sites do?

If I google "php __construct" I get php documentation as the first result.

Google knows when someone doesn't find the answer they're looking for from a result, I suspect the results you're seeing are the ones the majority of searchers for that query wanted.

Re:Discord Is Not Documentation by _gabe_ on Sunday July 16, 2023 @04:07PM (#36750916)
> The instantiation operation (“calling” a class object) creates an empty object. Many classes like to create objects with instances customized to a specific initial state. Therefore a class may define a special method named __init__(), like this:

  def __init__(self):
      self.data = []
> When a class defines an __init__() method, class instantiation automatically invokes __init__() for the newly created class instance. So in this example, a new, initialized instance can be obtained by:

  x = MyClass()
Seems like a good explanation to me? Maybe people are upset that it's buried a bit in the docs instead of having a tiny out of context statement about it?

[0]: https://docs.python.org/3/tutorial/classes.html

Re:Discord Is Not Documentation by dageshi on Sunday July 16, 2023 @04:39PM (#36751187)
Yes, I suspect people saw a wall of text and went back to look for a shorter answer.

I would guess google A/B tested those results till python.org fell off the front page.

More to the point, I don't think either google or the people searching are wrong for that. The query isn't "teach me about python classes" it's "what is python __init__?".

Re:Discord Is Not Documentation by _gabe_ on Sunday July 16, 2023 @09:05PM (#36752982)
Yea, I used to get annoyed when I saw results like this. But I appreciate them more and more. It's still easy to find what you're looking for with a quick Ctrl+F. But there inevitably comes a time when I want to understand a concept deeper, and I can come back to results like this for the longer explanation.

I know that it doesn't have to be either a long explanation or a quick and concise snippet of information, it can be both. But I find that a lot of docs will either have long explanations or short snippets (because time is finite and doing both is duplicating efforts), and in those cases, I prefer the long explanation.