TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Autocomplete from Stack Overflow

672 点作者 monort大约 9 年前

31 条评论

hbt大约 9 年前
It still astounds me that we haven&#x27;t solved reusable modules in 2016.<p>Sure, we have libraries, apis, package managers etc. but every time I read a code base, there is always a utility function reinventing the wheel.<p>Someone wrote it because it is still difficult to discover modular code and reuse it easily.<p>It&#x27;s pretty nuts when you think about it. Imagine mechanical engineers having to recreate the same CAD file because they can&#x27;t find a component with the same functionality (which does happen but for other reasons e.g intellectual property).<p>But we don&#x27;t have the same intellectual property challenges and yet the best tools we have to discover and reuse code are 90s search engines that treat code as raw text with zero contextual understanding and often outdated code snippets.<p>PS: I love your project btw.
评论 #11337416 未加载
评论 #11337746 未加载
评论 #11338563 未加载
评论 #11337077 未加载
评论 #11337021 未加载
评论 #11337094 未加载
评论 #11337322 未加载
评论 #11339634 未加载
评论 #11338138 未加载
评论 #11337538 未加载
评论 #11337484 未加载
sharmi大约 9 年前
Stackoverflow is an invaluable resource when you are a newbie or learning a new stack.<p>That said, the real value of stackoverflow is not only in the code but the surrounding explanation and the following comments which discuss the merits and demerits of each solution. So you get to read multiple solutions to the same problem and realize why the top answers standout from the others. In a way, you learn to smell good code and bad :)<p>So searching on StackOverflow can be a learning experience!<p>But these kind of developments might be the next step and who are we say?<p>One problem I foresee is, the highly rated solution could be for a specific version of the stack&#x2F;software ( the latest stable or the obselete, unmaintained one). In which case, you might end up with an error amplifying the mess.
ajmurmann大约 9 年前
I had a conversation with a coworker a few days ago where I jokingly suggested building an AI system that you give a failing test suite and it uses stackoverflow answers to make your tests pass. Sounds like we are one step closer to making that happen.
评论 #11337226 未加载
评论 #11337501 未加载
supergreg大约 9 年前
Rather than indexing StackOverflow, why not do this by indexing all the open source code out there? Sure StackOverflow answers are good, but they usually skip error checking for focusing on the question at hand. Code used in production applications surely is more sound.
评论 #11340176 未加载
评论 #11336353 未加载
评论 #11342660 未加载
creed大约 9 年前
Great idea, nice thinking!<p>I guess we as programmers should seriously think about the future of our craft.<p>If, for example, we feel we are basically using the same building blocks over and over again, we should seriously think about organizing libraries and code snippets and questions asking for such snippets in an organized way and provide ways to transpile 1 solution in different languages etc..<p>We should not accept the current state of our craft as final and rather think about how to improve in general.<p>If for instance something like StackOverflow has become the Wikipedia of Code then let&#x27;s think hard about how to make into a full blown tool, with all the features and semantics we need. It was a nice project the way it started and grew but it doesn&#x27;t have to stay like that forever!
ryannevius大约 9 年前
This isn&#x27;t working at all for me...Either I don&#x27;t get what it&#x27;s supposed to do, or the common functions I&#x27;m typing aren&#x27;t common enough. On a related note, 50 StackOverflow points seems like a high number for something like this, and may reduce the results significantly enough that the example doesn&#x27;t work for most common problems.
评论 #11337768 未加载
评论 #11335965 未加载
jnardiello大约 9 年前
If it&#x27;s a joke &quot;Ahah&quot;, if not it&#x27;s just depressing. SO is a valuable resource to confront and understand concepts. Let&#x27;s not encourage this copy&#x2F;paste culture
评论 #11336343 未加载
评论 #11336161 未加载
评论 #11336097 未加载
MrPatan大约 9 年前
Boss never wants a function, boss wants a solution to a problem, and your job is to know how to express that in functions. If you have the signature, 99% of your job is done.<p>I know you know, I know they know, and I know you know they know. I just wanted to say it, ok?
nateabele大约 9 年前
Haha, I love this. We&#x27;re getting closer and closer to the ultimate conclusion of our industry: where we&#x27;ll just type in a few keywords and generate full applications from StackOverflow code examples!
评论 #11336070 未加载
yitchelle大约 9 年前
If we put this in front of 1 million monkeys, would it generate the next killer app?<p>Anyway, this gave me a little laughter today.
评论 #11338048 未加载
braythwayt大约 9 年前
I have a good feeling about this:<p><a href="https:&#x2F;&#x2F;vimeo.com&#x2F;76141334" rel="nofollow">https:&#x2F;&#x2F;vimeo.com&#x2F;76141334</a><p>This is exactly the direction we should be going. We build the world&#x27;s most sophisticated engines for predicting human social behaviour, why are we stuck in the 1990s when it comes to autocomplete for a tightly scoped domain like writing software?<p>Bravo!
bprosnitz大约 9 年前
There was some research from Stanford a few years ago with a similar idea <a href="http:&#x2F;&#x2F;hci.stanford.edu&#x2F;publications&#x2F;2010&#x2F;blueprint&#x2F;brandt_chi10_blueprint.pdf" rel="nofollow">http:&#x2F;&#x2F;hci.stanford.edu&#x2F;publications&#x2F;2010&#x2F;blueprint&#x2F;brandt_c...</a>
byteface大约 9 年前
i did something similar one night a few months back, using python as a sublime plugin, but scrapes the live site. it eventually gets blocked tho as doesn&#x27;t use the official API.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;byteface&#x2F;chode" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;byteface&#x2F;chode</a><p>I considered hooking into a variety of other resources but haven&#x27;t really bothered with it as have other things going on.
robinduckett大约 9 年前
Seems to work very well for that one example, but I can&#x27;t get it to work for anything else.
评论 #11339962 未加载
WithTeeth大约 9 年前
Cool idea, but kind of ironic that the example you used produces unnecessarily complicated stack overflow solutions. A JavaScript &quot;contains&quot; function is as simple as:<p>var contains = function (needle, haystack) { return haystack.indexOf(needle) !== -1 }
评论 #11336863 未加载
评论 #11336257 未加载
sabujp大约 9 年前
Someone please make this for eclipse, vim, intellij, emacs, sublime, etc
falcolas大约 9 年前
A great way to increase your liability in an automated fashion!<p>Sure, the code on Stack Overflow is licensed as MIT... but what assurance is there that the code which was posted is original property that the poster owns copyright to? What assurance is there that the posters won&#x27;t claim patents on the methods being used?<p>The risk is low, but it&#x27;s certainly not 0. Big companies caution their software developers to not even read code in SO answers to avoid lawsuits... how much risk do you bring to your company by copying and pasting (not to mention autocompleting) from SO?<p>I am not a lawyer, etc. etc.
评论 #11336980 未加载
评论 #11336695 未加载
评论 #11336822 未加载
nottednelson大约 9 年前
Similarly: 2014 Springer volume (<a href="http:&#x2F;&#x2F;www.springer.com&#x2F;us&#x2F;book&#x2F;9783642451348" rel="nofollow">http:&#x2F;&#x2F;www.springer.com&#x2F;us&#x2F;book&#x2F;9783642451348</a>) and conference series that spawned it (<a href="https:&#x2F;&#x2F;sites.google.com&#x2F;site&#x2F;rsseresearch" rel="nofollow">https:&#x2F;&#x2F;sites.google.com&#x2F;site&#x2F;rsseresearch</a>).
Finbarr大约 9 年前
This should exist for Wikipedia. Would be great to autocomplete sentences as well as code.
pka大约 9 年前
Interesting. I was working on something similar [0] last year. Are you planning on publishing the code?<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9954059" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9954059</a>
rcarmo大约 9 年前
Pretty neat, although the &quot;training set&quot; probably doesn&#x27;t comprise what most people would need.<p>I&#x27;d like to see a version of this based, say, on React examples. Might save me some time :)
andgio大约 9 年前
Can&#x27;t really see this being useful if I&#x27;m honest. Here you are simply showing the code suggestions based on what the user is writing. You are completely ignoring both the context of the code being written by the user and of the code being suggested.<p>These are key functionalities in order to actually be usable. With this you simply get hundreds&#x2F;thousands of suggestions that are not related to what you are coding. And if by chance the suggested code is exactly what you want, then the variable names wouldn&#x27;t even match. This is assuming that the suggested code is complete and functional.
评论 #11336184 未加载
magic_man大约 9 年前
We can feed the SO data to a ml algorithm and pretty soon we won&#x27;t even need software engineers. Go today self coding computers tomorrow.
评论 #11336130 未加载
boksiora大约 9 年前
hahah :) someday we will say &quot;Computer make me a program&quot; and it will make it from SO posts
jrbapna大约 9 年前
Is there an atom extension for searching stack overflow snippets? if not, let&#x27;s build one!
评论 #11339474 未加载
mrfusion大约 9 年前
I don&#x27;t understand how it works? It&#x27;s just matching the function name?
评论 #11338098 未加载
mananvaghasiya大约 9 年前
Can somebody please make an Atom plugin for this? Oh wait...
daveheq大约 9 年前
It works great until it does something you don&#x27;t want.
bawana大约 9 年前
yes, but will this help a million monkeys smashing keyboards write the next great AI
mgalka大约 9 年前
Awesome project! Nice work.
blacktulip大约 9 年前
<a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;7SiQSD1.jpg" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;7SiQSD1.jpg</a>
评论 #11336292 未加载
评论 #11337103 未加载
评论 #11336381 未加载