Developer productivity is important to deliver your project on time. There’s a lot you can do as I already described in my blog post: Speeding up development: a collection of tips but even more is we dive into detail. In this blog post, I’ll give you some of my tips and tricks which I use on a daily basis to find my answers faster.
Interesting to point out is that in case of Stack Overflow you might want to use “accepted” instead of “solved”.Exclusive discount for readers of SwiftLeeThere’s always new tricks, tips, and skills to learn with Swift, so expand your insight with expert-authored books and videos from Manning. Here’s a special 40% off discount to dive into amazing Swift books and videos today. Use code psswift40 at checkout to get 40% off any Manning book or liveVideo.
Using the wildcard asterisk *
When you’re running into an issue in Xcode you’ll often get an error message containing a specific type.
Although you’ll often find your answers with common errors it’s not always that efficient. For that, you could use the wildcard asterisk
*. You simply replace your specific type with the
* like in this example
Coyote.HomeViewController (0x1010b01f0) and
Coyote.BucketListViewController (0x10bd7f580). This includes your app name, class name, and the pointer, which are all unique to your app. The final keywords you’ll type in Google will be:
The above improvement resulted in a total of 578.000.000 results vs a total of 2 without the asterisk. As you can see in the above example, the search results are much more precise and what you need!
Using a specific domain
Developer productivity can be even more improved if you know where to search. If your searching for a specific code example it’s likely that you want to search on Stack Overflow. Taking the above example, we would search as followed:
This narrowed down the number of results to 810.000. The results are way more specific to our case and more likely to contain the answer we’re looking for.
Use “solved” as an extra search term
Although it’s not an officially supported feature in Google, it does boost your developer productivity by trying to filter out unsolved questions.
This narrows down the number of results to 295.000 and brings us even closer to the right answer.
If you’re wondering why I’ve put the solved keyword at the beginning instead of the end, it does make a difference! The order of keywords influences the priority and brings different results. In fact, the first result in the above example by using solved at the end is not marked as solved at Stack Overflow. However, Google is probably smart enough to find out if an answer is good based on its data.
Using “accepted” instead of “solved”
Interesting to point out is that in case of Stack Overflow you might want to use “accepted” instead of “solved”. This works better as Stack Overflow marks answers as accepted instead of questions as solved. However, “solved” seems to work better in general with other websites.
Wouldn’t searching directly on Stack Overflow improve developer productivity even more?
Well, you might think that’s true. However, searching for the same answer on their search page isn’t that efficient. Even with only searching for Swift related answers and questions including an accepted answer the search results are quite disappointing.
Although this is specific to Stack Overflow and other websites might be better at this, it could be that other sites have the same issue. Therefore, it’s case by case and you have to find out yourself sometimes.
Other search examples
The above example is great for finding answers for specific code problems. However, sometimes you want to find something else, like a document scanning library written in Swift:
Or maybe you like to find a specific SwiftLee blog post 😉
Or, if you want to teach somebody else how to search on Google for a Swift Blog, try this.
I hope that this blog post boosts your developer productivity. If not, or if you think that there are even more tips I should know, reach out to me on Twitter.