Hacker News new | ask | show | jobs
by necovek 1849 days ago
To be honest, Google returning SO answers for something that is exactly not what I am looking for instead of language/library reference documentation as it used to is one the most annoying things for me as a developer today. Though I think that's mostly on Google "optimizing" my queries by dumbing them down.

As an example, try looking for "python setattr" in your search engine of choice, and look for python.org documentation: none of them show it on the first page for me.

13 comments

I also frequently run into the situation where I Google something, there is a perfect match on a SO question, but then the answer is "Actually, you don't want to do that thing you asked about, here is a different solution for your specific scenario". But often that alternative solution is not relevant in the general case, and there really are good reasons to want to do the thing as originally asked in the question.

Basically there are all kinds of situations where the specific question/answer format is actually at odds with generating good long-term documentation.

But that makes me all the more impressed with the success Stack Overflow has had. In my opinion their key insight is that it can be good enough. If I had come up with the idea for the product I probably would have been discouraged and given up way too early based on the fact that it is and will always be messy and imperfect.

> there is a perfect match on a SO question, but then the answer is "Actually, you don't want to do that thing you asked about, here is a different solution for your specific scenario".

That describes seemingly every Stack Overflow question I've found in the past four years. SO is basically useless for anything advanced enough to need SO.

Perhaps there’s a point at which you become advanced enough to not need SO. I’m certainly not there after a decade of software development. Do I have to dig a bit sometimes and go beyond the first few results on google? Sure. And if that doesn’t work I submit a question. I normally get an answer fairly quickly.
> Perhaps there's a point at which you become advanced enough to not need [something like] SO.

Not really, no, which is why it's so infuriating when people ruin it with "How do I do X?" "You aren't supposed to do X, here let me tell you how to Y instead.". The HTML/regex Zalgo rant at least had some style, even if it was utterly useless at answering the question.

I think the subset of programmers who don’t need something like SO’s value proposition is vanishingly small. Surely there are a few hundred people who have near perfect recall bolstered by perfect reference techniques.

At least speaking for myself, almost two decades in, I didn’t outgrow SO because I don’t need that kind of guidance. I outgrew SO because it doesn’t provide it effectively anymore.

There are topics on which Stack Overflow is worse to useless to me, mostly because I could probably name most of the experts who are better than me in the field and of course have ways of getting in touch with them on that. But I doubt there is anyone out there for which this is the situation for all topics.
Ironically the biggest problem I have today is that a lot of Q/As on SO are old, so it's hard to know if the answer I found is still canonical or if there's a better/different way to do the same thing, and I didn't perform the right incantations into google to find my answer.
> Though I think that's mostly on Google "optimizing" my queries by dumbing them down.

I'd say it's become a lot worse than it was just a couple years ago when you could massage the queries to get you exactly what you want. Now google seems to think it's more clever than you and turns every question into an entry level one.

I’ve used Google’s custom search engine (cse) to help solve this, when working on a project, just make a cse with the main sources of official docs for the stack you’re using; instead of getting 20 possibly related questions with half solutions that you have to wade through, you get straight to the source docs. I guess it works best when those source docs are good, eg postgres, but it’s certainly been a big win for me
On Chrome, go to chrome://settings/

Search for "search engines"

Open "Manage search engines"

Under "Other search engines" click on "Add" (on the right)

Add this custom search engine:

- Search engine: Python docs (first result)

- Keyword: p

- URL with %s in place of query: {google:baseURL}search?q=site:docs.python.org%2F3%2F+%s&btnI=I%27m+Feeling+Lucky

Install the "Redirect Google Redirects" extension https://chrome.google.com/webstore/detail/redirect-google-re... (otherwise you'll see a "Redirect Notice" page)

You can also add this search engine:

- Python3 docs

- pp

- {google:baseURL}search?q=site%3Adocs.python.org%2F3%2F+%s

Now, when you need to search for the Python documentation, just type "p setattr" and it'll go straight to https://docs.python.org/3/library/functions.html or you can search "pp setattr" and it'll show you the search results, filtered only for docs.python.org/3/

Thank you for your elaborate answer. Now please provide it for Firefox.

And Postgresql. And Flask. Now I am using aiohttp here. SQLAlchemy please. Pytest. Sorry, now in the Rust world. Get me some MDN for Javascript. w3.org for CSS3 spec, pleaaaseee!

You see where this is going? Python.org was an example to illustrate a point.

If you’re using a Mac, you might want to try Dash[1]. I’m sure similar tools exist on other platforms, but I’m not familiar enough to recommend them.

1: https://kapeli.com/dash

I have a few suggestions:

- Dash, the macOS app for language and library documentation is really nice. This is the first thing I go for.

- Chrome notices when you visit a page with a "Search" box. Next time you start typing python.org you can press tab to search the domain. I wish Firefox had this.

- AFAIK, Firefox's version of this is to RMB on a search box (for example on python.org's main page) and "Add a Keyword for this Search..." Set it to something like "py" and you can now type "py http" and it would search Python.org for "http"

- I honestly get better results from DuckDuckGo for stuff like this. Even better, they have bang! shortcuts. "subprocess !py2" will search Python.org's Python2 documentation for "subprocess" https://duckduckgo.com/bang

Those bangs look great. Really useful to know.
I'm not responding to your criticism of Google Search. I'm suggesting to anyone who shares your sentiment something that improved my dev experience.

I also use the uBlacklist extension to hide W3Schools et al. https://chrome.google.com/webstore/detail/ublacklist/pncfbmi...

I actually make these whenever I get frustrated by Google a few times. I have "m" for MDN... It's not hard you just need to pick a keyword. How to modify the URL in the search string should be pretty obvious. I think you'll find you don't need them for every library. It's mostly general tools with large user bases, like Python, where people are trying to make a living shitting up the search results.

If you use DuckDuckGo as your search engine you use the bangs that you add to your query, e.g.

  !w bang
searches for bang on Wikipedia. The list of bangs can be found here [0]

python: !python !python2 !python3

Postgresql: !postgres

Flask: !flask

SQLAlchemy: !sqlalchemy

Rust: !rust

Javascript: !javascript

CSS: !css

Currently there are 13,564 bangs and you can suggest new ones.

[0] https://duckduckgo.com/bang

Alternatively: set DuckDuckGo as your default search engine and type `!python setattr`.
But if you're looking for something as specific as the documentation in Python itself for setattr, why wouldn't you do

```

> python

Python 3.7.4 (default, Aug 13 2019, 20:35:49)

[GCC 7.3.0] :: Anaconda, Inc. on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> help(setattr)

```

Or if you want the documentation on specifically Python.org, use Google search but type

`setattr site:python.org`

?

The third hit for me is https://docs.python.org/3/library/functions.html

Maybe Googlebot is reading this thread.

Remember that Google is not showing the results the same way to everyone. Maybe others near me are more likely to click on the SO response so I get that one ranked higher, and less likely to click on the reference documentation, so I get targeted the same way.

Maybe if I let Google learn my patterns instead of disabling all the tracking I can, it'd give me better results.

FWIW, I get similar results with DDG, but Google wins hands-down on non-English searches.

I’m still trying to train Google to stop giving me W3Schools results and... I don’t have high hopes.
I see docs.python.org as result 9 (of 10) in duckduckgo. And there's a helper box at the top right, with the summary from and link to docs.python.org
7th on DDG for me.
> As an example, try looking for "python setattr" in your search engine of choice,

!python setattr

Or am I not allowed to add a character? :)

> try looking for "python setattr" in your search engine of choice, and look for python.org documentation: none of them show it on the first page for me.

I was curious and tried exactly that. For me, Google returns python.org as the third hit, above Stack Overflow.

Zeal (if on Linux) or Dash (if on Mac) are a lifesaver for that stuff.

It's ironic that I use Zeal so much but it really does just give me the answers quite often with less hassle than figuring out the search term to tell the search engine to get out the way!.

The sample you gave (and my experience in general) has official docs on the first page, but unfortunately below the fold. Top answers include various tutorial sites and an SO answer.

Ninja edit: my default search engine is DDG.

I just tried this, and the official python language docs came in third with SA just after. Now, for sure, it should be first, instead of the dumbed down tutorials, but it's certainly on the first page.
I've found DuckDuckGo better for searching for specific terms or functions like this. OTOH, google seems better for more vague concepts (like "python add attribute").