New feature makes Bing a programmer’s sidekick
Microsoft is stepping up their search engine. Bing now provides you with a sample code snippet that could save you time when you program. Is this a unique feature?
Bing has been the source of jokes, as the search engine constantly struggles to keep up with the Google behemoth. While we all say, “Let me Google that”, no one ever says, “I was Binging around last night and found the coolest thing.” Maybe we should?
Code Sample Answer saves developers time
Code Sample Answer is a new feature for Bing that will help developers find code snippets quickly and easily. The Bing blog suggests trying the sample query “convert case using a function in R” to see this new feature. Let’s take a quick look and search.
The first (non-sponsored) result is from Stackoverflow, linking to an appropriate question and answer. This is expected, however there is now one more additional thing. Underneath the search result is a code sample.
Bing makes it clear that this feature works for languages outside of the Microsoft family, so no matter what you code in this feature will work.
SEE ALSO: D3.js for the busy Angular developer
So, what do the gears behind Code Sample Answer do?
From the Bing blog: “The natural language processing pipeline of Bing accomplishes this by converting the query to equivalent ‘coding query key-phrase’. Bing’s language agnostic code understanding engine then ensures the results correctly reflect the intent based on holistic query understanding rather than on simple, individual keyword matches.”
Finding the user’s intent and clarifying ambiguous queries is also important. Searching for Python is obviously different depending on whether or not you need some source code or if your pet snake is hungry. One will search for sample code, the other will search for a pet supply store.
Once the query is classified as code vs. non-code query and key-phrase terms are identified, Bing’s language agnostic code understanding engine intelligently interprets the developer intent. This understanding of the intent is built from signals such as specific syntax, any API, tool or language names used in the query that are currently popular in the development community.
Where does Bing pull the code from? There is an established list of trusted sites including Stackoverflow, GitHub, W3Schools, MSDN, Tutorialpoints, and more.
Finding source code isn’t its only use either. Users can also search for git commands and other developer tools.
Bing states that this feature is in development, so any feedback should be directed at them in order to make it better. As the search engine’s confidence grows and more links are made, better and better source code will be found and displayed.
How does Bing stack up?
Time out, let’s answer a question. Does Google have this feature? As of right now, no, the big G does not present users a code sample. After searching the same query, here is my first result:
No code preview to be found. You will also note that the first hit is still StackOverflow, but it is a different question and answer than the one provided by Bing.
However, there is one contender. The privacy-friendly search engine DuckDuckGo did provide something similar.
Again, you will note that the preview is different than the one provided by Bing.
Is this new feature enough to make Bing a viable search engine tool for programmers or will Google be the go-to for hunting down source code? Have you given it a try?