9 Jul

Weekly Update 109: Owning the query space

This is a copy of our weekly newsletter for developers which you can subscribe to here.

Hello contributors,

We often recommend that developers try to "own" a query space. In other words, that they develop Instant Answers (IAs) for searches related to a particular topic they're interested in. You are all experts in something and so are better placed than we are to know things like:

  • What content users are looking for
  • What's missing from current Instant Answers
  • What data sources are best

One good example of this is contributor Manraj Singh who has created most of our C++ cheat sheets. Each of them are for a specific C++ niche and form the long tail of searches that only human contributions can properly cover.

So, in your area of expertise, are there programming topics we're currently under-serving? If these are currently covered by cheat sheets, could you go one step further and make a command/function lookup IA? Or perhaps within a particular language there are sub-topics that could have their own specialized IA.

Hopefully, that provides some inspiration, but if you're looking for specific ideas for contributing here are some suggestions...

5-minute Fixes

More quick fix ideas here...

Weekend Warriors

More high priority fix ideas here...

IAs for Adoption

The following Instant Answers are looking for a maintainer — someone to moderate suggested changes from the community as well as address any issues that pop up in the future. If you'd like to step forward, please create an issue on GitHub using the button at the bottom of each IA page.

Quick Tip

As you probably know, we use Perl a lot to power DuckDuckGo and our Instant Answers. Personally, I'm still learning the unique features of Perl but there's one cool thing I'd like to share that I haven't seen in other languages.

Very often we need to makes lists of items, sometimes to quickly test a much larger list. In Perl this can be done without quotes and commas using the qw function, for example:

my @list = qw(apple orange banana);

Perl will understand this as though you've written:

my @list = ("apple", "orange", "banana");

As you can see, it's just a small reduction in characters but not only does it save time, less typing also means less chance of bugs.

There are other similar functions such as qq, qx and just q which also handle strings and quotes, so I'll let you investigate those for your homework :-)

And with that, we wish you all a nice weekend everyone!

- The DuckDuckGo Staff

3 Tweet

This blog has been archived

Thank you for reading and contributing lively discussion to our blog! Read more posts about online privacy on our new blog at spreadprivacy.com.

I was waiting for this update, it will only ensure that I would have all.

posted by Gaetann • 1 year and 5 months ago Link

FYI, Ruby has the same feature with the following syntax:

Perl Code:
list = %w[ apple orange banana ]
posted by <hidden> • 1 year and 5 months ago Link

Thanks for the heads up! Feel free to chime in any time with improvement suggestions for our community: duckduckhack.com

posted by zac Staff • 1 year and 5 months ago Link