Microsoft Launches Smart Visual Studio Add-On For Code Snippet Search

Comment

Whether you are a seasoned programmer or a beginner, chances are you spend a lot of your time looking for code snippets on Stack Overflow and similar sites. There’s no need to reinvent the wheel, after all. Now, a team from Microsoft Research in Cambridge wants to streamline this process and bring it into the IDE. The team today launched the Bing Code Search add-on, which directly integrates code snippet search for C# (with other languages coming later) into Visual Studio.

What’s important here is that this isn’t just a basic search tool. Instead, you can ask queries using natural language (“how to read files line by line”). The tool’s language processing and search is powered by Bing, and everything runs on Azure.

The team has indexed snippets from Stack Overflow, MSDN, Dotnetperls and CSharp411. All the snippets in the index were automatically checked to ensure they compile, but in the search, the algorithms also look at votes from the given community that the snippet comes from and other quality signals.

The best thing, though, is that it doesn’t just copy and paste the snippet into the code, but it will also try to modify the code to fit the variables you already use in your own code.

Even if you don’t have Visual Studio installed, you can try a web-based version (with a slightly different interface) here.

bingcodesearch1

As Youssef Hamadi, a senior researcher at Microsoft Research Cambridge and Yi Wei, a post-doc researcher who worked on this project with Hamadi, told me, having your own variables in the code makes it far easier to read the code, as most programmers who have ever copied and pasted a code snippet can probably attest to.

For single-variable queries, the tool is about 70 to 80 percent accurate in picking the right variable. For snippets with two variables, it’s at just over 60 percent. Unsurprisingly, it also tends to perform better, the more common the question is.

Hamadi believes the tool will appeal to all levels of developers, but he thinks that beginners will definitely benefit from it, because it will make it easier for them to learn how to use a language, as well as very advanced programmers, who can quickly determine which snippet will work best in their code.

bingcodesearch2

In Microsoft’s internal tests, programmers who used the Bing Code Search add-on were over 60 percent faster in solving a battery of coding exercises than those who used regular web search.

As for the partnerships, Stack Overflow’s VP of engineering David Fullerton told me that he doesn’t expect this integration to hurt its traffic. Every snippet, he noted, will also show a link to the original source, and he expects that developers who want to dive deeper into the code and see the comments and discussion around the snippet will continue to be active in the Stack Overflow community.

For the time being, the team considers this tool an experiment, but if developers react positively to it (and it’s hard to see why they wouldn’t), it may just become a built-in Visual Studio feature. Over time, the team also plans to support more languages. C# is obviously a very important language for Microsoft and has a very active developer community (and the Stack Overflow community, for example, has historically been very .Net-centric anyway).

Looking ahead, it’ll be interesting to see where Microsoft takes this technology. Taken to the extreme, you could maybe even start programming using just natural language queries in the long run. Hamadi hinted that Microsoft has more planned for the technology that the team developed.

More TechCrunch

After Apple loosened its App Store guidelines to permit game emulators, the retro game emulator Delta — an app 10 years in the making — hit the top of the…

Adobe comes after indie game emulator Delta for copying its logo

Meta is once again taking on its competitors by developing a feature that borrows concepts from others — in this case, BeReal and Snapchat. The company is developing a feature…

Meta’s latest experiment borrows from BeReal’s and Snapchat’s core ideas

Welcome to Startups Weekly! We’ve been drowning in AI news this week, with Google’s I/O setting the pace. And Elon Musk rages against the machine.

Startups Weekly: It’s the dawning of the age of AI — plus,  Musk is raging against the machine

IndieBio’s Bay Area incubator is about to debut its 15th cohort of biotech startups. We took special note of a few, which were making some major, bordering on ludicrous, claims…

IndieBio’s SF incubator lineup is making some wild biotech promises

YouTube TV has announced that its multiview feature for watching four streams at once is now available on Android phones and tablets. The Android launch comes two months after YouTube…

YouTube TV’s ‘multiview’ feature is now available on Android phones and tablets

Featured Article

Two Santa Cruz students uncover security bug that could let millions do their laundry for free

CSC ServiceWorks provides laundry machines to thousands of residential homes and universities, but the company ignored requests to fix a security bug.

19 hours ago
Two Santa Cruz students uncover security bug that could let millions do their laundry for free

OpenAI’s Superalignment team, responsible for developing ways to govern and steer “superintelligent” AI systems, was promised 20% of the company’s compute resources, according to a person from that team. But…

OpenAI created a team to control ‘superintelligent’ AI — then let it wither, source says

TechCrunch Disrupt 2024 is just around the corner, and the buzz is palpable. But what if we told you there’s a chance for you to not just attend, but also…

Harness the TechCrunch Effect: Host a Side Event at Disrupt 2024

Decks are all about telling a compelling story and Goodcarbon does a good job on that front. But there’s important information missing too.

Pitch Deck Teardown: Goodcarbon’s $5.5M seed deck

Slack is making it difficult for its customers if they want the company to stop using its data for model training.

Slack under attack over sneaky AI training policy

A Texas-based company that provides health insurance and benefit plans disclosed a data breach affecting almost 2.5 million people, some of whom had their Social Security number stolen. WebTPA said…

Healthcare company WebTPA discloses breach affecting 2.5 million people

Featured Article

Microsoft dodges UK antitrust scrutiny over its Mistral AI stake

Microsoft won’t be facing antitrust scrutiny in the U.K. over its recent investment into French AI startup Mistral AI.

21 hours ago
Microsoft dodges UK antitrust scrutiny over its Mistral AI stake

Ember has partnered with HSBC in the U.K. so that the bank’s business customers can access Ember’s services from their online accounts.

Embedded finance is still trendy as accounting automation startup Ember partners with HSBC UK

Kudos uses AI to figure out consumer spending habits so it can then provide more personalized financial advice, like maximizing rewards and utilizing credit effectively.

Kudos lands $10M for an AI smart wallet that picks the best credit card for purchases

The EU’s warning comes after Microsoft failed to respond to a legally binding request for information that focused on its generative AI tools.

EU warns Microsoft it could be fined billions over missing GenAI risk info

The prospects for troubled banking-as-a-service startup Synapse have gone from bad to worse this week after a United States Trustee filed an emergency motion on Wednesday.  The trustee is asking…

A US Trustee wants troubled fintech Synapse to be liquidated via Chapter 7 bankruptcy, cites ‘gross mismanagement’

U.K.-based Seraphim Space is spinning up its 13th accelerator program, with nine participating companies working on a range of tech from propulsion to in-space manufacturing and space situational awareness. The…

Seraphim’s latest space accelerator welcomes nine companies

OpenAI has reached a deal with Reddit to use the social news site’s data for training AI models. In a blog post on OpenAI’s press relations site, the company said…

OpenAI inks deal to train AI on Reddit data

X users will now be able to discover posts from new Communities that are trending directly from an Explore tab within the section.

X pushes more users to Communities

For Mark Zuckerberg’s 40th birthday, his wife got him a photoshoot. Zuckerberg gives the camera a sly smile as he sits amid a carefully crafted re-creation of his childhood bedroom.…

Mark Zuckerberg’s makeover: Midlife crisis or carefully crafted rebrand?

Strava announced a slew of features, including AI to weed out leaderboard cheats, a new ‘family’ subscription plan, dark mode and more.

Strava taps AI to weed out leaderboard cheats, unveils ‘family’ plan, dark mode and more

We all fall down sometimes. Astronauts are no exception. You need to be in peak physical condition for space travel, but bulky space suits and lower gravity levels can be…

Astronauts fall over. Robotic limbs can help them back up.

Microsoft will launch its custom Cobalt 100 chips to customers as a public preview at its Build conference next week, TechCrunch has learned. In an analyst briefing ahead of Build,…

Microsoft’s custom Cobalt chips will come to Azure next week

What a wild week for transportation news! It was a smorgasbord of news that seemed to touch every sector and theme in transportation.

Tesla keeps cutting jobs and the feds probe Waymo

Sony Music Group has sent letters to more than 700 tech companies and music streaming services to warn them not to use its music to train AI without explicit permission.…

Sony Music warns tech companies over ‘unauthorized’ use of its content to train AI

Winston Chi, Butter’s founder and CEO, told TechCrunch that “most parties, including our investors and us, are making money” from the exit.

GrubMarket buys Butter to give its food distribution tech an AI boost

The investor lawsuit is related to Bolt securing a $30 million personal loan to Ryan Breslow, which was later defaulted on.

Bolt founder Ryan Breslow wants to settle an investor lawsuit by returning $37 million worth of shares

Meta, the parent company of Facebook, launched an enterprise version of the prominent social network in 2015. It always seemed like a stretch for a company built on a consumer…

With the end of Workplace, it’s fair to wonder if Meta was ever serious about the enterprise

X, formerly Twitter, turned TweetDeck into X Pro and pushed it behind a paywall. But there is a new column-based social media tool in town, and it’s from Instagram Threads.…

Meta Threads is testing pinned columns on the web, similar to the old TweetDeck

As part of 2024’s Accessibility Awareness Day, Google is showing off some updates to Android that should be useful to folks with mobility or vision impairments. Project Gameface allows gamers…

Google expands hands-free and eyes-free interfaces on Android