Use DuckDuckGo to find answers as a developer
I pride myself on teaching the developer skills that not many people focus on â dealing with rejection, understanding business, finding work⌠those kinds of things. Hereâs a skill that I use every day but hadnât even considered talking about: searching.
It occurred to me when I found an article by Marko Denic on how to use Googleâs search syntax. I highly recommend you check it out. Itâs a quick read, and, even though Iâm searching all day every day, I picked up a few new tips.
The one thing I donât care for about the article is that itâs very Google-centric. Weâre well past the âdonât be evilâ Google of the past and into the âmaneuver around the law and common decency in an effort to collect the most possible data on our usersâ era of the company. Itâs why I switched over to a privacy-focused search engine called DuckDuckGo.
Iâm going to be up-front with you. The results on DDG are not always on par with those on Google, and I do still use Google when I need to. What I find, though, is that for 90% of the searches I need to do, DuckDuckGo works just as well and sometimes better.
Google is much better at finding results in online discussion which is very useful when youâre trying to find the answer to a specific question. Google will return multiple results from StackOverflow, Reddit, and support forums. DuckDuckGo has these, but it seems to find fewer of them and it doesnât always surface the relevant ones.
Hereâs my simple search workflow:
- Try my search on DuckDuckGo.
- In the event I donât find what Iâm looking for, I add â!gâ to my search to search on Google.
This uses a DDG feature called âbangsâ that allow you to send your search over to another site. Adding â!gâ just sends your same search over to Google. Youâll get back the Google results for your search terms (on Google; theyâre not proxied through DDG, so itâs literally identical to searching on Google).
This always feels like giving up (and frankly, it is), but the bangs feature goes beyond just redirecting failed searches over to Google. DDG has thousands of bangs, and many of them are super useful for developers. Here are a few you might find useful:
- !mdn- Mozilla Developer Network
- !sof- StackOverflow
- !csst- CSS-Tricks
- !r- Reddit
- !dev.to
These are just the ones I think are most generally useful to developers, but there are tons of these things. You have language-specific bangs like â!pyâ for searching the Pyton documentation, front-end framework specific bangs like â!vueâ for the Vue documentation, and tool-specific bangs like â!vscodeâ to search the Visual Studio Code docs. I could go on, but instead you should check out DDGâs bangs page and find the bangs that will help you code faster.
You could still use âsite:mdn.orgâ for example to search just on the MDN site, but this works differently from a bang. The bang searches through the siteâs own search engine. Limiting your DDG search to a site using âsite:â still uses DDGâs search and not the siteâs own search. Either approach might be useful depending on the context.
You might be wondering, âWhy wouldnât I just go directly to the site I want to search and search there instead of going to DDG and using a bang to redirect my search to the other site?â Iâd reply, âThatâs an astute observation, intelligent reader,â and proceed to address it like so: bangs shine when DDG is your browserâs primary search engine. If you decide to set DuckDuckGo as your browserâs search engine, you can now search directly from the address bar, giving your address bar some cool superpowers.
You can now type your search in the address bar to search DuckDuckGo, or you can type your search and add â!gâ to search Google (e.g. âflexbox !gâ). Maybe that leads you to a StackOverflow article with a recommendation for a book on CSS. Awesome! Now, you hit command/control-L to focus the address bar again and type â!a flexbox in cssâ to find the book on Amazon. (Note that your bang can go anywhere in the search. It doesnât have to be at the end.) Then, you order the book and search â!mdn flexboxâ to find a quick reference on MDN while you wait for your book to ship. Thatâs the true power of the bang.
In case youâre wondering about the search tips in the Marko Denic article, most of them work in DuckDuckGo.
- Quotes work the same way.
- The âANDâ and âORâ keywords donât exist in DDG, but search terms are implicitly âORâed.
- The minus (-) operator is slightly different in DDG. Where Google eliminates results with the term, DDG gives the term specified by the operator less weight. Itâs not as useful, but it can still get the job done.
- Wildcards donât seem to work in DDG, best I can tell.
- Limiting search to a site with âsite:â or to a file type with âfiletype:â works exactly the same.
- Numeric ranges and dates in the search donât work, but you can date limit the search via DDGâs UI.
So, weâre close to feature parity, but not quite there. Itâs going to be enough for most searches. If you absolutely need to refine a search by adding a wildcard to it, just do it and also add the â!gâ hashbang to send that search over to Google instead.
There are two things I want you to take away from this article:
- Take some time to improve your searching skills. Itâs a massive part of what we do as developers and, even though itâs not tested in interviews like algorithms and data structures, itâs a skill youâll get a lot more milage out of in the long run.
- You donât have to throw all your data into Googleâs data lake in order to get great results. At the same time, you donât have to quit Google cold turkey.
Thanks for reading. Hope this will help you find whatever it is youâre searching for!