Bing Now Provides Exact Snippets of Code for Developers' Queries (searchenginejournal.com) 84
"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?"
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?"
Duck Duck Go started this (Score:4, 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
Let me bing up a vrius (Score:5, Interesting)
Re:Let me bing up a vrius (Score:4, Interesting)
Re: (Score:2)
Here's someone who built the obligatory XKCD: https://gkoberger.github.io/st... [github.io]
Re: Let me bing up a vrius (Score:2)
Re: (Score:3, 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.
Re: (Score:3)
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.
Re: (Score:2)
Nothing wrong with whistling up a quick code snippet, as long as you understand it.
Exactly! Real programmers will spot the trap, cargo-culters won't.
Re: (Score:2)
Because you are not allowed, under any circumstances ever, to be a beginner.
There's a difference between a beginner tinkering on his own toy box at home and a "programmer" that doesn't even know what O(n) means leaving customers' private data for every script kiddie for the taking.
Re: (Score:2)
Re:Let me bing up a vrius (Score:4, 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.
Comment removed (Score:5, Informative)
Re: (Score:2)
No one would suggest a fork bomb on the Internet.
Almost - accidental backdoors everywhere (Score:3)
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
Re: (Score:1)
I think you really should type up an article explaining why the code snippet is wrong and how to do it correctly, and then link that article here and other places when you talk about it. That way the search engines will eventually start serving up the right answer, and history will credit you as the one who taught everyone the right way to do it.
tl;dr: Please write an article and start linking to it.
Code in which language (Score:3)
Let me guess: it's always C# ?
Re: (Score:2)
Re: Code in which language (Score:2)
Python is not the most popular, though it's moved up a lot. Languages without static typing are barbaric
Re: Code in which language (Score:2)
Re: (Score:2)
Python is not the most popular, though it's moved up a lot. Languages without static typing are barbaric
As older /.ers will remember, "Real Programmers don't write in PASCAL, or BLISS, or ADA, or any of those pinko computer science languages. Strong typing is for people with weak memories." - Real Programmers Don't Write Specs [multicians.org]
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
Coming from
Ha! I see what you did there...
Re: (Score:2)
Coming from Microsoft, it's probably more like Intercal.
{
Whoosh();
}
Wow! (Score:1)
Zero day exploits ahead (Score:2)
Re: (Score:3)
Re: (Score:2)
$ dotheneedful --on-having-one-doubt 'revert same'
Re: (Score:3)
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.
I am a clueless manager... (Score:3, Insightful)
Re: (Score:2)
Re: (Score:2)
Manager: "What are you talking about, 2-4 weeks? This problem shouldn't take you more than an hour. Just ask Bing for the code!"
Developer: "Bing, tell me what code to add to Windows to make it suck less."
Re: (Score:2)
The Internet, as far as search engines go, was long ruined well before this.
Most of the stuff you have to dig into obscure google docs or use "advanced search" to get google to do -- it used to do quite well back in the days either naturally with a few obvious extra search terms, or with some rather more well documented syntax... it got significantly dumbed down in 90s and some stuff it just can't do anymore.
No fan of Bing, but making search engines more code-aware (not code-aware as in "oh that's code bett
Weird (Score:2)
Bing extracts "the best matched code samples from popular, authoritative and well moderated sites like Stackoverflow
If it got popular enough, this would impact the number of upvotes. And the whole idea of StackOverflow is that upvotes determine a working answer.
Re:Copyright (Score:1)
Three wrong answers (Score:1)
"C++ opengl draw triangle" returned:
float c = -1.0 + 2.0*desiredPixel/pixelWidth
"C++ opengl set vertex shader" returned:
// (Vertex buffer must be bound at this point)
glEnableVertexAttribArray( a );
glVertexAttribPointer( a, 3, GL_FLOAT, GL_FALSE, sizeof( your vertex ), nullptr );
"C++ directx 11 create 3d texture" returned:
desc.BindFlags = D3D11_BIND_SHADER_RESOURC
Re: (Score:2)
Nope, nope, nope...
At least you got an answer. I queried about transparent connection to IPV4/IPV6, about accepting a TCP connection, and about multiplying to matrices in C, and I got zilch...
Samples are not for production (Score:2)
It's good that samples are easily available, as code often explains a concept better than documentation for many developers.
The risk is that these samples are just copied in to an application with all the codesmells that it contains.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
This is not good. They are just too lazy (or rushed) to read any documentation.
Often, documentation is also lazy or rushed... and leans heavily on code samples.
Re: Samples are not for production (Score:2)
Not a good thing (Score:4, 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.
Comment removed (Score:4, Insightful)
Re: (Score:2)
I fully agree on that.
Re: (Score:2)
All corporations remove support far away from developers.
When I worked for Tivoli systems (just post-IBM-buyout) I was the liaison between my team (TME10 Inventory) and the developers. I brought our concerns to them, and they would address them. I would ask them questions about how the product was actually supposed to work, and I would bring those responses to my team. Sometimes I would literally overhear one of my coworkers giving a customer the wrong answer, and I would be able to tell them "no, that's not how that works" specifically because not all corporatio
Re: (Score:2)
True. I don't think I'd ever trust what a search engine thought was the correct answer from SO. I'd be much more comfortable looking to see the context of the code. Was there disagreement about the answer, or an alternate approach not marked as answer but with a higher rating? Were there caveats? Is there additional error handling required?
This is all stuff a responsible programmer would definitely want to know when they get their answer.
Re: (Score:3)
Re: (Score:2)
It's like the programming equivalent of an automatic shotgun, where someone thought that shotguns needed to fire faster and less accurately.
If your goal is to throw a lot of lead into a crowd real fast, an automatic shotgun is relatively practical. Or if you want to use less-lethal rounds like beanbags, and expect to have to engage multiple assailants with them. So no, it's nothing like that, because those make sense and this doesn't.
Re: (Score:3)
Well, that and it means MS is spewing their code around, probably contains STDs.
Stealing Page Hits (Score:2)
Search powered by GitHub? (Score:2)
So (Score:2)
I knew I had already seen this (Score:3)
It's been on DuckDuckGo for quite some time. Often quite useful.
come on (Score:1)
just change that stupid name already!
id say thats 95% of reason why i dont use the stupid thing. the rest is the shitty search that dont find anything