Sooner or later, every programmer ends up searching for code snippets and algorithms. Most search engines, though, don’t exactly specialize in code search and so you end up with a couple of links (one of them most likely to StackOverflow). Now, Microsoft has partnered with HackerRank to bring code snippets right into its Bing search results pages — and as an added twist, you can also edit and execute this code right on those pages, too.
To trigger this, all you have to do is search for something like “string concat C#” or a similar question and Bing will pop up the editor for you. Using the widget, you can also switch to other languages as well. Depending on the algorithm you’re looking for, the options here include C, C++, C#, Python, PHP, and Java.
HackerRank co-founder Vivek Ravisankar tells me the project currently features over 80 code snippets that focus on the most commonly searched terms.
Microsoft is positioning this as both a productivity and learning tool.
“In addition to learning how a certain algorithm/code is written in a given language, users will also be able to check how the same solution is constructed in a range of other programming languages too — providing a Rosetta-stone model for programming languages,” says Marcelo De Barros, Group Engineering Manager for the UX Features and Shared Tools at Bing.
If you’re a Visual Studio user, it’s also worth checking out Microsoft’s Developer Assistant plugin (previously known as the Bing Code Search add-on), which allows you to find and reuse over 21 million code snippets and samples right from within the IDE.