16 Sep

Weekly Update 119: The Status of Swift

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

Hello contributors,

We have one more language from our programming mission to get an update for, and it's Swift (including other Apple developer-related searches).

The main sources of data for new Instant Answers so far have been the helpful SwiftDoc.org and Apple's official developer reference. They enable IAs that should greatly help Apple developers, for example:

Screenshot of a Swift Instant Answer

As usual, we're grateful to have extra help from the contributors in the community, in particular Xinjiang and Sahil. You can join them and help create Apple-related Instant Answers that offer even more lookups, code snippets and tools. Details and current status are in the Swift Overview post on the forum, where Zaahir and Jag are happy to help.

And now, here are some specific issues we're currently looking for help with...

5-minute Fixes

More quick fix ideas here...

Weekend Warriors

More high priority fix ideas here...

Quick Tip

This is more good practice than a tip, but worth a reminder anyway. Whether beginner or expert, it's sensible to name your variables and functions descriptively. This may seem obvious but a lot of code, for example when looking at the source code of web applications, has very short variable names, sometimes just a single letter. This is because the code has been passed through a minifier, making it smaller in size but also harder to read. Don't copy names from this code!

Instead, decide on a naming convention that makes your code readable by humans, whether that's your colleagues, open source contributors, or even you in a few years time. Two rules that have helped me are:

  • Start function names with a verb
  • Start booleans with "is" or "has"

For instance, examples of easy-to-understand function names include showMessage or startTimer. Examples of clear boolean variable names include isActive or hasContent. These are all very readable and make it obvious what the code does.

Like many areas of programming, there are different opinions about naming conventions but this is a good starting point and definitely better than using abbreviations or inconsistent terms.

That's all for now. Enjoy your weekend everyone!

- The DuckDuckGo Staff

2 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.

ok, thank you for the update, it's help us. I wish you too a good weekend

posted by Emeric7 • 2 years and 6 months ago Link

Thank you Emeric7!

posted by tagawa Staff • 2 years and 6 months ago Link