Live data from Hacker News

Autocomplete from Stack Overflow

emilschutte.com

141–150 of 151 posts

Re: Autocomplete from Stack Overflow

#141
post #76

Earlier quoted context omitted.

But we have this in software. On the JVM, Maven repos are essentially an enormous repository of existing modules that you can pull in your project with a one line addition to your build file. This covers small utility libraries to manipulate strings or dates (like the one you allude to) to entire ecosystems like web containers and everything in-between. I don't understand what part of this doesn't qualify as a "reusa…

npm and maven modules are not easily discoverable - How do you search for a function other than by description or name. Assuming the developer classified properly and you even happen to use the same domain language as the writer. - When multiple modules are returned, similar packages, how do you compare and select efficiently without wasting hours reading the code, evaluating it, checking if it is still maintained an…

> - How do you search for a function other than by description or name.

You were asking for modules and now you're down to the function level. That's a much easier problem to solve. Hoogle, Javadoc, documentation and good index engines solve this problem easily.

Note that type only is pretty ambiguous and most of the time useless without additional metadata. Types tell you what, they don't tell you why or how.

> - When multiple modules are returned, similar packages, how do you compare and select efficiently without wasting hours reading the code, evaluating it, checking if it is still maintained and hoping there are no hidden bugs etc.

At some point, the human brain has to step in and make a call. You can't expect an automated tool to dictate to you the code you need to write.

Re: Autocomplete from Stack Overflow

#142
post #50
post #40

Earlier quoted context omitted.

...12 hours of involuntary surgery later: There, now you're a facebook clone.

This is close to a real pun it would do, and nearly just as dire. It's fixed in recent versions, but it used to not understand emergencies. If you said "Siri, call me an ambulance," it would come back with "OK, I'll call you 'an ambulance' from now on."

I still remember searching on Apple Maps for "hospital," and getting a map with every emergency veterinary clinic within 50 miles.

Really, Apple? Nobody thought of this use case? You shipped this thing with that little forethought?

Re: Autocomplete from Stack Overflow

#144
post #62

It still astounds me that we haven't solved reusable modules in 2016. 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. Someone wrote it because it is still difficult to discover modular code and reuse it easily. It's pretty nuts when you think about it. Imagine mechanical engineers having to recreate the same CAD file bec…

This is one of the best qualities of languages like Haskell, the type system promotes discovery and true reuse of code. There has even been research into specifying dependencies as 'something that implements this signature' rather than specific packages.

Yeah haskell is amazing. I'm still really looking forward to the day when somebody writes something actually useful in haskell. (Oh but pandoc, xmonad, shellcheck... in how many years?) ;-)

Re: Autocomplete from Stack Overflow

#145

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.

Good idea. Can you provide a download link with all the code out there?

Re: Autocomplete from Stack Overflow

#146

Earlier quoted context omitted.

That actually sounds realistic. A well defined test suite is probably a good target for AI. Main issue is no partial wins, which are needed for training, so you'd need to break all functionality down into absolutely minimal units.

Also if you overfit, your code is going to look like: int add(int a, int b) { if (a == 1 && b == 1) return 2; if (a == -1 && b == 0) return -1; if (a == 13 && b == 7) return 20; return 0; } But at least it passes my unit test suite!

This can be avoided by optimizing for the simplest code that works. Checking many cases in multiple lines is always going to be longer and more complex than just a single operation on a single line.

Which is how AIs avoid overfitting, in general, by penalizing complexity.

Re: Autocomplete from Stack Overflow

#147
post #119

Earlier quoted context omitted.

Maybe the likes of you someday will get a job and then understand that "what you support" does not depend on you.

Please don't post uncivil comments here.

Yea I'm sorry but it just gets on my nerves when people post things like "just don't support it!".

I would if I could, everyone would if they could.

Re: Autocomplete from Stack Overflow

#148
post #119

Earlier quoted context omitted.

Please don't post uncivil comments here.

Yea I'm sorry but it just gets on my nerves when people post things like "just don't support it!". I would if I could, everyone would if they could.

Believe me, I understand how comments like that get on one's nerves. But civil discourse requires those of us with nerves to tolerate the irritation enough not to toss it back. The system has no steady state: the irritation either grows or we dampen it.

Re: Autocomplete from Stack Overflow

#150

Earlier quoted context omitted.

A good start would be for Github to host a package that contains the latest versions of each repo. However even they may not have that right (depends on TOS).

What they really need is a way to rank github code by quality - so that a tool like this pulls in the good code (as opposed to code of lesser quality)

Have the code editor report back to the cloud the amount of times a certain snippet was "selected"/used. And just rank the drop-down box/autocomplete options accordingly.
Post reply on HN