Ever wondered where coders go looking for help when they’re at sea?
Here’s one of the most common productivity pitfalls for programmers today: If you want to improve on or learn a new algorithm, you search in engines and figure out which blue link to click. You’ll then have to transfer all of that into your local editor.
You’ll then need to use a trial-and-error approach to figure out which snippet fits your code and runs the program accurately. A tad tedious, you think? Well, think again. Coders roughly take about three minutes to search the top three webpages and figure out which code to use.
With the Bing-HackerRank solution, one can zero down on the right code within 30 seconds.
HackerRank, having already made waves by disrupting the tried-and-tested IT recruitment strategy, has now set its sights on becoming the go-to search engine for programmers.
Challenges currently faced by coders
“When you’re learning a new language, you want to first get comfortable with it. For instance, if I’m trying to learn French, it’d be easier for me if I knew the equivalent words in English,” explained Harishankar Karunadhi, co-founder, HackerRank.
Similarly, most programmers are comfortable with C or C++. So when they decide to pick up a new language, they look for a “translation tool” that churns out equivalent commands in the new language.
The Bing team realized that if the code snippet could be directly displayed, instead of the user having to explore numerous search results to see if it matches their query. This proves to be a much better option for the programmers, as they are able to save a lot of time for query resolution.
What really makes the cut for coders is the fact that they are able to run the code online, without having to download it to their text editors and running it locally.
“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,” said Marcelo De Barros, Group Engineering Manager for UX Features and Shared Tools, Bing.
With the industry hurtling down the silicon alley at breakneck speeds, it’s not okay anymore for coders to know just one or two programming languages. With ‘Polyglot’ (the trend of programmers learning multiple languages), they’re comfortable with any language.
“This is probably the biggest challenge right now – There are new technologies evolving. Companies like Google and Facebook are launching new languages on their own. You need to be up to speed on those,” said Karunanidhi.
So, what’s in it for a coder?
Let’s take the simple example of writing a ‘Hello World’ program. You know how to write the program in C++. You'd now like to know how to write the program in Java.
With Bing’s new solution, all you need to do is type the command in the search box, choose the language you want it translated to, and run the code on Bing search.
This gives coders the advantage of not having to explore numerous search results before zeroing in on the right one. In addition to this, the coders don’t have to download the program ontheir systems to run the program.
“What used to happen earlier is that you had ten search results. If you clicked on the first few results, that site may or may not have the code for ‘Hello World’ in a language you were looking for,” explained Karunanidhi.
“Now what is going to happen is that in the search result itself, we show the code which can be run on Bing’s search page. This comes much handier when I’m actually writing a code, because there are probably close to about 10,000 functions in any programming language these days, and there’s no way I could remember all of that. I might remember a function that would be able to execute the command, but not the exact function itself,” he added.
This means one could quickly search how to reverse a string in Java, and get the code snippet there, which can be copy-pasted wherever needed. Needless to say, this can save a whole lot of time for a coder.
The next question that arises is how does this tool outperform other solution-providers?
“Let’s say I write a piece of code in those editors to print all the prime numbers. If none of my variable names, or if no word in my code has the word ‘prime number’ in it, a search engine cannot understand that this code is for prime numbers. But here, if you search for prime numbers in Java, we’re going to show you the code there which you can either copy or run,” explained Karunanidhi.
Debugging made easy
Another advantage this search option provides is that coders can change the code in the search engine, and run the code to test for accuracy.
Also, if the search lists how to write a program to print prime numbers till 100, programmers can change the limit to 1000, and test the output in Bing’s search engine itself. This also eliminates the need to import the program on the coder’s computer.
So, what made Microsoft zero in on HackerRank?
Bing’s senior director leading this project is a HackerRank user, who also happens to be rated among the top two percent in the HackerRank community. This is what led to Bing reaching out to HackerRank.
“We thought it’s a great initiative, and we also worked from our end to ensure that the code snippets can be integrated into Bing. It sounded like something which should have been there by now, but since it wasn’t, we thought it’d be a good idea to take it up,” beamed Karunanidhi.
Initially, when the company started working with Bing, they did an A/B test (split testing to compare two versions of a webpage) with some set of their users. After running this test for a month, they were very positive of the outcome, and they wanted to roll this out to all their users in their platform.
“Bing wants to roll this out with more code snippets in the next three months, and once they do it, I think it’s only a matter of time before others catch up,” he added.
HackerRank’s focus points for 2016
One of the key focus points for the company this year will be on learning. “We’re working to create a community where beginners can get started. Whatever we had till now was more on programmers who knew a programming language, but wanted to get better at it,” said Karunanidhi.
In addition to that, HackerRank wants to help enable learners to get started with a basic language. For instance, how to run your very first program on Java.
The company aims to cover the entire lifecycle of a coder – From someone who wants to just get started with programming, to taking them through all the concepts of the particular language.
“Once they are familiar with the basics, we introduce them to more advanced concepts in the language. The users can then move to learning about AI or machine learning. We hope to connect the dots for the user, and make it a seamless learning experience.
HackerRank has also made tutorials available for the learners. These tutorials have challenges in between for the user to solve before advancing to the next level. The tutorials constitute about 40 percent, while the lion’s share is devoted to solving challenges and learning from them.