Weekly Update 110: Show us your code
This is a copy of our weekly newsletter for developers which you can subscribe to here.
I'm very proud that we get lots of people starting their programming lives by contributing to DuckDuckGo. Together with the welcoming community, my hope is that it's an opportunity both to learn new skills and to be part of a greater mission that benefits people around the world.
But programming's not easy and we all run into bugs and errors. That's why we have an #ask-anything Slack channel where you can ask for help with any problem, big or small. To make this easier, however, I have one bit of advice for when you seek help:
You may feel a bit shy about people seeing your code before it's ready, especially if you know it doesn't work properly, but it's worth being brave and making it public. If you make it clear that it's a work in progress, then there's no pressure to have working code, and it also makes it much easier for others to help you. We have some highly skilled developers who are happy to help with issues whenever they see someone in need. Being able to put comments next to specific lines in GitHub is very effective for this. Not only that, but other programmers who see the code will learn from it as well.
So don't be shy! Show us your code and feel free to ask (or answer) questions in Slack. If you've not joined yet, you can invite yourself here. And if you're just not sure what to work on, here are some suggestions...
- Visual Studio Cheat Sheet: Add more shortcuts
Apparently there are many more shortcuts that could be added to this cheat sheet. Do you know of any?
- Ski Resorts: Overtriggering
An easy fix is to ignore queries containing "airport map".
- iOS error code shows USPS tracking page
We should find a way to stop the over-triggering in the USPS IA.
- Solar System: Convert to JS Goodie
The benefit is that we'll be able to display units in the user's preferred format.
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.
either at the top of your whole script (my recommendation) or within a function.
- Declare variables without
- Use reserved words as variable names
- Use the
These, and a few other advantages, will make your code more secure and help you develop better coding practices. In addition, because it's just a string, it will be ignored by browsers that don't understand it, so you don't need to worry about backwards-compatibility issues. A double win!
And as a bonus, it can be used in Perl too, although the syntax is slightly different:
Whichever language, I recommend you use this in all your code unless you have a very good reason not to.
And with that, we wish you all a safe weekend.
- The DuckDuckGo Staff