
C# Autocomplete Demo Using Bing Code Search Engine - miket
http://codesnippet.research.microsoft.com/
======
tlb
One of my pet ideas is a new programmer's editor that uses proportionally as
much compute resources as Emacs did in the late-80s. An amount of computing
that would show up as a major line item on your department's timesharing bill.

1000 cores costs around $50/hr, so if it boosted my productivity measurably
it'd be worth it. Searching all public github code for strings matching around
my cursor seems like the sort of thing these 1000 cores should be doing.

~~~
ThisIBereave
It should be noted that public github repos are _not_ public domain and not
even necessarily open source unless the author specifies a license.

~~~
timr
It's part of the GitHub terms of service:

 _" By setting your repositories to be viewed publicly, you agree to allow
others to view and fork your repositories."_

~~~
rtb
Permission to "view and fork" is not the same as permission to copy and paste
into a proprietary software product (i.e. this may not be legit for use by
"enterprise" developers)

------
doczoidberg
the linked page is an old version. New version:
[https://visualstudiogallery.msdn.microsoft.com/a1166718-a2d9...](https://visualstudiogallery.msdn.microsoft.com/a1166718-a2d9-4a48-a5fd-504ff4ad1b65)

------
taternuts
This seems like a really cool idea, but I'm not sure how useful it'd end up
being. I also wasn't able to get it to actually work with anything other than
the demo question they provided

~~~
calineczka
Me as well.

------
Avalaxy
I installed the plugin, restarted VS, but nothing happens when I type:

/// convert string to byte array

and press tab afterwards.

Am I missing anything?

Edit: actually something does happen... it inserts a tab, just like any VS
installation would do.

Edit 2: from browsing through the comments it seems like it might be a
ReSharper conflict. They said they would update it though, but in 8~9 months
nothing has changed apparently.

~~~
DevKoala
Have you tried to uninstall and install ReSharper? In the past when ReSharper
has prevented other plugins from working, that has been my solution.

~~~
Cilvic
I don't have ReSharper installed but get the same problem. The IntelliSense
has improved but neither /// nor the "bring up IntelliSense and click the "How
do I" button shown in the video works for me ..

------
zamalek
It also aptly demonstrates the issues with doing internet searches for code,
the snippet in the demo has a bug!

Still, it's a crazy neat idea.

~~~
squeaky-clean
The demo comes directly from the msdn, which is also funny. A cool feature
would be the ability to rate the code snippet, and then searches could be
filtered by rating. For snippets from websites with voting features, like
Stack Overflow, it could display the number of votes, and maybe the comments
for the snippet, or the rest of the post text. Often I don't want to just know
"what code does X" but "how to do X".

Seems like the search could be better anyways. The StackOverflow result for
that example is from a post with 4 other (more useful) examples, but it picks
the last one. It was also not the selected Answer for that post.

This is still really cool, even in it's current state, I think I will find it
useful.

------
arikrak
I always thought that people should have more built-in search power when they
code. It's funny that Microsoft is taking the lead over Google on this, though
I guess Google doesn't have their own IDE.

Soon, modular projects will just consist of searching and plugging in
components...

~~~
murki
Android Studio.

~~~
kevinchen
Visual Studio is a lot more important to Microsoft than Android Studio is to
Google.

------
cl8ton
I installed on VS2013 Ultimate wo/Resharper and here is how it worked for me.

The '///' then tab does nothing but when I start typing in the IDE however it
kicks in with a much better Intellisense complete with the Bing snippets like
depicted on the VS Gallery. So perhaps they limited the slash+tab sequence?

------
crb002
Why aren't we using git like hashes for compilers? Take referentially
transparent parts of code, blob together and make a hash of the AST in a
canonical form and a hash of the assembly, source, transforms used, and
benchmark stats. The compiler would run continiously searching for new
solutions.

------
Nate630
Nice idea. Sort of changes ideas as to what an IDE can/should do.

~~~
icebraining
Related: Joe Armstrong's ideas on a global code database:
[http://erlang.org/pipermail/erlang-
questions/2011-May/058768...](http://erlang.org/pipermail/erlang-
questions/2011-May/058768.html)

(Armstrong is the inventor of Erlang, by the way)

------
nickdandakis
Does anybody know of a Sublime Text or Atom package that does this?

~~~
architech
[https://github.com/azac/sublime-howdoi-direct-
paste](https://github.com/azac/sublime-howdoi-direct-paste)

~~~
k1t
Probably also worth mentioning the commandline tool that I assume this
(howdoi-direct-paste) is based on:

[https://github.com/gleitz/howdoi](https://github.com/gleitz/howdoi)

Previous discussion:
[https://news.ycombinator.com/item?id=5027021](https://news.ycombinator.com/item?id=5027021)

------
cturhan
I typed

///how to parse json

and it waits...

------
vblord
This is a great idea, but I can't get the website to work. I will try the IDE
because this is actually pretty useful.

------
mcescalante
Unfortunately I don't write much C# (took a few courses that heavily used it)
so it's going to be hard for me to really get an idea of what this feels like
to have access to all the time (i.e. know if it's really useful). I'd really
love to see what it feels like with a scripting language like Python or
Javascript

------
TorKlingberg
I tried the web version, but it just says Loading. Do I need to install
Silverlight?

~~~
mstromb
No, it doesn't seem so. I have Silverlight installed but set to click-to-run,
and the site will provide suggestions for the sample without running the
Silverlight control.

------
justinlloyd
I fear for the future of working with copy/paste programmers, but then my
fears are probably unfounded because after all, this uses the Bing search
engine. Searching for "///how to sort an array" will most likely just give me
the top ten tourist hotels in Paraguay instead.

~~~
orbifold
The problem is that only part of a solution to a problem is really in your
control. Each has a potentially very large number of solutions, most of them
are equivalent (renaming of variables, isomorphic control flow etc.), but some
are inequivalent. For example in Haskell you could at least use iostreams,
pipes, conduit or lazy io to solve the read file in and print its lines. You
can't expect a developer to be familiar with every choice the Library
implementors made, especially since lots of libraries do not really have
stellar documentation.

------
sysk
Waiting for the Vim plugin :)

------
kyberias
Because we need to have more people using random copy-pasted code in their
programs.

~~~
BigChiefSmokem
Yes, I rather my juniors cut and paste from StackOverflow because it means
they are using a _modern_ coding pattern and can learn from it and see great
commentary about why this was the "chosen" pattern.

How else are we supposed to learn?

Same goes to all these clowns who champion one language/platform over another
simply because of ego.

~~~
devcjohnson
"...because it means they are using a modern coding pattern and can learn from
it and see great commentary about why this was the "chosen" pattern."

Unfortunately it means no such thing. I have seen junior engineers search
stack overflow and click for easiest/fewest lines of code with no regard to
why.

You took the OP extreme view and countered it with your own which is equally
biased. Let everyone just be honest about it is all.

How else are we supposed to learn? Actively thinking and engaging others when
we don't know.

~~~
kyberias
My view is that it's probably not wise to automate copy-pasting code from the
internet. It easily leads to just that: copy-pasting and not thinking. I'm
sure that this view is not that extreme really.

