Earlier quoted context omitted.
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…
Hoogle helps for Haskell projects, as you can search by Type, and the Types are expressive enough that that actually finds what you're looking for most of the time.
Autocomplete from Stack Overflow
131–140 of 151 posts
Re: Autocomplete from Stack Overflow
#132Earlier quoted context omitted.
It's fortunately not _that_ easy to get a software patent. It'd be quite difficult to patent something that's the length of an average stackoverflow answer. There's also a lower limit on the length (and originality) for copyright which I doubt many answers reach.
I can fit the concept of mp3 decoding and a sample decoder in a few dozen lines of text and code. This is a patented technology (for another year or two, at least).
Re: Autocomplete from Stack Overflow
#133Earlier 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!
Re: Autocomplete from Stack Overflow
#134Earlier quoted context omitted.
I can fit the concept of mp3 decoding and a sample decoder in a few dozen lines of text and code. This is a patented technology (for another year or two, at least).
I severely doubt that. Would love to see it though!
Re: Autocomplete from Stack Overflow
#135Earlier quoted context omitted.
Haskell has Hoogle[1], which allows you to search for functions using a type signature. This is surprisingly effective. Let's say you want that `contains` function from the original post. You'd search for `(Eq a) => a -> [a] -> Bool`, which describes a function that takes two parameters and returns a boolean. The first result[2] is the `elem` function, which is exactly what we wanted! This is a bit of a contrived exa…
Does the order of the parameters matter? It's been a while since I've touched Haskell, so maybe it's obvious that this isn't [a] -> a -> Bool for some idiomatic reason. I guess that would be `isContained` instead of `contains`, so it probably wouldn't be the first thing I search for, but there's at least some potential for ambiguity.
If there are multiple close matches, ordering of arguments can change which is first, but the one you're looking for is almost always in the first few.
[1] https://www.haskell.org/hoogle/?hoogle=%28Eq+a%29+%3D%3E+%5B...
Re: Autocomplete from Stack Overflow
#136I 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.
Have you heart of StackSort? https://gkoberger.github.io/stacksort/
Re: Autocomplete from Stack Overflow
#137Earlier quoted context omitted.
I've often told people that I'm just a good programmer, but a phenomenal Googler. Even in interviews. Being able to search and separate the wheat from the chaff is most definitely a skill. Unless you always want to be reinventing wheels.
Yeah but when you found the wheat you still need to know how to make bread.
EDIT: Unless your job is to invent a better bread recipe.
Re: Autocomplete from Stack Overflow
#138Re: Autocomplete from Stack Overflow
#139Earlier quoted context omitted.
One big reason I've seen people "reinventing" small utilities and modules is to avoid external dependencies, both for licensing and management hassle.
This is a big one. External dependencies are a liability, you need to be getting enough value out of them to offset their cost. For small one-off functions it's often better to just rewrite the thing than to pull in a library and have to worry about versioning or the library being abandoned or the API changing or the package manager on your target system not having that library or only having an old version or one th…
Re: Autocomplete from Stack Overflow
#140It 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…
Haskell has Hoogle[1], which allows you to search for functions using a type signature. This is surprisingly effective. Let's say you want that `contains` function from the original post. You'd search for `(Eq a) => a -> [a] -> Bool`, which describes a function that takes two parameters and returns a boolean. The first result[2] is the `elem` function, which is exactly what we wanted! This is a bit of a contrived exa…