Slashdot Mirror


Bing Now Provides Exact Snippets of Code for Developers' Queries (searchenginejournal.com)

"Bing has launched a new intelligent search feature which provides the exact piece of code a developer is looking for," writes Search Engine Journal. An anonymous reader quotes their report: The code snippet will appear right on the search results page itself, which means users will not have to skim through long threads and articles to find the one thing they're looking for. Bing calls this new feature a "Code Sample Answer" and says it's designed to help save developers' time. "Many of us are developers too, and we thought: what if Bing were intelligent enough to do this for us? What if it could save users' time by automatically finding the exact piece of code containing the answer to the question? That is how Code Sample Answer was born..."

A Code Sample Answer will trigger only when Bing intelligently detects the coding intent with high confidence. "To achieve this level of precision for query intent detection, Bing's natural language processing pipelines for developers leverages patterns found in training data from developer queries collected over the years containing commonly used terms and text structure typical for coding queries. The system also leverages a multitude of click signals to improve the precision even further"... [I]t also covers other tools used by developers. For example, a Code Sample Answer can be triggered when searching for git commands and their syntax.

Bing extracts "the best matched code samples from popular, authoritative and well moderated sites like Stackoverflow, Github, W3Schools, MSDN, Tutorialpoints, etc. taking into account such aspects as fidelity of API and programming language match, counts of up/down-votes, completeness of the solution and more."

JAXenter.com notes they obtained similar results using the privacy-friendly search engine DuckDuckGo, and ultimately asks whether this functionality could affect the search habits of developers. "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?"

20 of 84 comments (clear)

  1. Let me bing up a vrius by xack · · Score: 4, Interesting

    It won't be long before stuff like fork bombs and data deleters get "suggested" for common programming queries.

    1. Re:Let me bing up a vrius by Fly+Swatter · · Score: 3, Interesting

      More likely will be snippets that download harmless sounding payload and execute.

    2. Re:Let me bing up a vrius by KiloByte · · Score: 2, Insightful

      It won't be long before stuff like fork bombs and data deleters get "suggested" for common programming queries.

      I don't see a downside. Someone bad enough to code via cargo culting snippets shouldn't be allowed anywhere near actual data. Sure, it'd decimate Javascript and PHP coder base, but that's not a downside either.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    3. Re:Let me bing up a vrius by Dracolytch · · Score: 3, Informative

      I just checked some quick examples in JavaScript, and didn't love the syntax it gave back as a result. Meanwhile, the StackOverflow pages in the search results provided much more correct answers. StackOverflow's answers often provide context, which is very important when building software.

      --
      This sig has been enciphered with a one-time pad. It could say almost anything.
    4. Re:Let me bing up a vrius by datavirtue · · Score: 4, Informative

      Yeah...anyone who runs a search and employs the first snippet they find is a moron. There is context and the need to make sure you and most everyone else is not doing it wrong. A lot of times you can find an answer on SO but you need to read all the way to the bottom and follow the links to other SO posts and answers to find the best way to handle something. When you don't know what you are doing it is often difficult to judge what is correct.

      TLDR; Cut and paste coding is more involved than just cut and paste.

      --
      I object to power without constructive purpose. --Spock
    5. Re:Let me bing up a vrius by cascadingstylesheet · · Score: 2

      It won't be long before stuff like fork bombs and data deleters get "suggested" for common programming queries.

      I don't see a downside. Someone bad enough to code via cargo culting snippets shouldn't be allowed anywhere near actual data. Sure, it'd decimate Javascript and PHP coder base, but that's not a downside either.

      Nothing wrong with whistling up a quick code snippet, as long as you understand it.

  2. Code in which language by Applehu+Akbar · · Score: 2

    Let me guess: it's always C# ?

  3. Duck Duck Go started this by Jeremiah+Cornelius · · Score: 3, Informative

    They have been returning command syntax for queries like "ffmpeg deinterlace" since last year, at least.
    ffmpeg -i input.vob -vf yadif -c:v libx264 -preset slow -crf 19 -c:a aac -b:a 256k output.mp4

    --
    "Flyin' in just a sweet place,
    Never been known to fail..."
  4. I am a clueless manager... by richrz · · Score: 3, Insightful

    Now I can forward more stuff to look smart!

  5. Not a good thing by gweihir · · Score: 3, Insightful

    It will allow some "developers" that have no clue what they are doing to fly under the radar for some more time and do more damage. And that is basically the only thing this will do.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    1. Re:Not a good thing by datavirtue · · Score: 3, Insightful

      These people have taken over. They are now development managers, senior developers, and architects.

      You know how you learn not deploy shit code to production? When you have to support it. Most of the people in the above mentioned roles have never had to support software in production, much less troubleshoot the root cause. I have, and the most common issue has been copy-pasta code and snippets from popular websites and blogs (sprinkle in the failure to read the documentation).

      All corporations remove support far away from developers. All corporations have absolute shit software despite the army of professionals working for them. They throw it over the wall and call it a day. The managers insulate the team from issues by lying to management or not telling them at all.

      --
      I object to power without constructive purpose. --Spock
    2. Re:Not a good thing by gtall · · Score: 2

      Well, that and it means MS is spewing their code around, probably contains STDs.

    3. Re:Not a good thing by skoskav · · Score: 2

      It's like the programming equivalent of an automatic shotgun, where someone thought that shotguns needed to fire faster and less accurately.

  6. Stealing Page Hits by narcoossee · · Score: 2

    So they're stealing page hits and ad impressions of the sites providing this code. Google does the same thing when you ask it questions - they show what they believe to be the answer, with a link to the source...which you'll probably never click through to, because you've already gotten your answer.

  7. Re:So Visual Studio's code editor by datavirtue · · Score: 2

    Shh... don't give them any ideas. Managers and executives already think everything is easy/simple. If they hear about this it will only lead to more ham-fisted bullshit. Never mind, we have already jumped the shark.

    --
    I object to power without constructive purpose. --Spock
  8. Search powered by GitHub? by devslash0 · · Score: 2

    I can't help but think that this feature has more to do with the recent acquisition of GitHub than we know. Seems like Microsoft has started using your code to power its search engine and monetize your code. What about copyrights? Does it respect terms outlined in projects licences?

  9. So by SurenEnfiajyan · · Score: 2

    I'm, going to buy a workstation with 1TB of RAM and search in Bing "Windows implementation, course work". I hope this will bring an example of a working Windows source code and the browser won't crash.

  10. I knew I had already seen this by cascadingstylesheet · · Score: 2

    It's been on DuckDuckGo for quite some time. Often quite useful.

  11. Almost - accidental backdoors everywhere by raymorris · · Score: 2

    Example, or explanatory, code very frequently comes with a note such as "data validation and error handled omitted for clarity". They aren't kidding - important code is left out in order to leave bare only what's being demonstrated. Putting such code online without proper validation and error handling is putting a glaring security hole in place.

    I wrote a snippet of demo code years ago which was put into production on hundreds of thousands of web sites, though it should not have been. I demonstrated an idea with some code, which wasn't supposed to be production ready. A popular site copy-pasted it from my site, and others copy-pasted it from there. It ended up on Stack overflow repeatedly and other places as copy-pasted code that many, many people used in production. It was not secure.

    Without checking, I would bet that Bing is serving up my code when someone searches how to do that, because it's on many well-known sites. It's not secure, production-ready code, though. It's demonstration code illustrating a certain technique.

  12. Re:So Visual Studio's code editor by cas2000 · · Score: 2

    Don't be ridiculous, developers can't be expected to remember and type long complicated command lines.

    It'll be a button, with a dialog box for the options. A huge blinking button in prime screen real-estate so nobody can miss it. In a stunningly helpful UI innovation almost as good as Clippy, the mouse pointer will gravitate towards the button whenever the user is idle for a few seconds.

    It'll be trademarked, marketed, and patented as One Click Programming.