Weekly Update 128: Documentation refresh
This is a copy of our weekly newsletter for developers which you can subscribe to here.
Following on from the announcement of our first combined list of issues last week, we've been trying to make things easier when you decide to pick up a task and get coding. In particular, that means improvements to DuckDuckHack documentation both with small edits and corrections, as well as new information such as this article explaining How to review a pull request. Several parts have been rewritten so if you haven't checked out the docs recently, now's a good time to take a look.
Also, you may not know that the docs themselves are open source. If you find areas that are confusing or could be improved, please feel free to raise an issue or suggest a change in the duckduckhack-docs GitHub repository.
And speaking of GitHub, here are a few high-priority issue suggestions from our IA repositories...
- jQuery: Add redirects
We want to add redirects using each jQuery documentation article's categories and the method name.
- MDN JS: Add disambiguations for error types
We should link to all available articles for a particular error message.
- MetaCPAN: Behaviour for exact match
We should expand useful information if the search remainder matches a module name exactly.
- Python: Separate Python2 only articles into new Python2 Fathead
This will enable us to specify as many Python2 trigger words as we want in the IA.
And these redirects should have "type" and "data type" postfixed.
- MDN JS: show the first example in the article
For some articles we only show the syntax; instead, we should try to show the first example box.
Python has many helpful built-in features so let's take a look at one in particular. Whatever language you code in, you may have tried to display a list of strings by joining them together with commas, often added using a
for loop. With each iteration you add a comma, but you have to remember to drop it for the final iteration. You guessed it — Python makes this easy.
Let's say you have a list such as:
birds = ['duck', 'goose', 'swan']
Instead of a
for loop you simply use
join, which needs to be preceded by the separator you wish to use. For example:
print ', '.join(birds)
That will print
duck, goose, swan — simple, huh? Not only that but it's also faster to execute than a for loop.
var output = birds.join(', ');
And with that, have a great weekend everyone!
- The DuckDuckGo Staff