3 ms·
I feel the opposite. I think, in the future, ideally, you will be able to do a programming interview, using a tool like kite, in a language you don't know and
by inputcoffee 10y ago
I feel the opposite.
I think, in the future, ideally, you will be able to do a programming interview, using a tool like kite, in a language you don't know and feel comfortable.
So when I am learning a new language, I don't want to have to look up if the length of a vector is len(), length(), .len, .len(), .length() and so on. In fact, I don't want to do this for languages that I do "know".
- zeptomu 10y agoBut what if it's called "size"?
- foota 10y agoMaybe a synonym aware documentation searching autocomplete?
- klibertp 10y agoIt works like this: aCollection.<TAB> list of all the method on given collection pops up. If it's short, just skim it and choose something which appropriate. If it's long: aCollection.l<TAB> check if there's something similar to length/len, use it, otherwise: aCollection.l<BACKSPACE>c<TAB> check if there's something similar to count then use it, if not: aCollection.l<BACKSPACE>s<TAB> check if there's something similar to size and use it. Finally, if all the guesses failed, defer to documentation or google. Basically, (semantic) auto-complete is an inline quick-search facility for docs. Very, very useful if you know how to use it effectively.
- ssijak 10y agoor use ctrl+shift+space in intellij and it will just show completions that return type maching the left side of equation :) or press it 2 times and it will look for all aCollection.. for the matching types ;) very powerfull
- zeptomu 10y agoThis only works for languages that provide dot-like syntax. E.g. in Python (which is a little bit inconsistent in this regard) the equivalent would be "len()" and I am not sure how it should work there, as there is no context to infer the function/method. I get your point though and there are cases where completion might be useful, but for me the context-switch to a search engine is just not that much of a hassle, but maybe I never enjoyed a good completion engine, so I might give it a try.
- klibertp 10y agoJedi (I use it with Emacs and auto-complete) does a fairly good job for Python. While the `len` being a function screws things up a little, there are many places where you can still use autocompletion the way I described, specifically: import module module.<TAB> and: def meth(self, ...): self.<TAB> and even: foo = Foo() foo.<TAB> It doesn't work for all possible cases, but as you said, you can always consult Google. It's just that I prefer not to leave my editor if I don't really have to. OTOH, I work with a lot (10+) of different languages and find even the dumb, basic autocompletion (which only offers to autocomplete words already present in the file) helpful. As other commenters noted, writing aLongAndDescriptiveFunctionNameToCall from memory every time may be inconvenient for two reasons: a) was it aLongAndDescriptive... or aDescriptiveAndLong...? and b) writing this much text takes time, and the more letters you have to type the more probable a typo gets. Anyway, I think you should give a try to a few different auto-completion plugins/systems and see for yourself. You should probably spend a little time to configure such a plugin so that it doesn't get in your way when it fails (ie. has no good completion to offer), but once you make it so the auto-complete may become really helpful to you. Or it may not, but I think it's worth checking out.
- inputcoffee 10y agoI think right now we are at the tip of the iceberg. In 5 years, once average computers are very fast, you will get something like. len -> did you mean size() based on the fact that so many other people have entered that. I am sure there are other ideas besides that haven't even occurred to us.
- yorwba 10y agoWhy wait 5 years? Using a synonym database (or word vectors, if you want to get fancy) would already get you most of the way there. I am not aware of any IDE that specifically tries to give you the most likely alternative, but many absolutely do offer a way to quickly select a different method from a list.
- inputcoffee 10y agoYou're right that the tech is probably there now. But you need some user testing, and maybe some ML. I mean, the machine needs to train enough to know that when the user types "string.len" they really mean "size(string)" and it can't just follow the alphabet anymore.
- yorwba 10y agoAllowing arbitrary syntax transformation would create an insanely large search space, but if you limit the possibilities to a few common cases (like string.len -> size(string) [attribute -> global function] or amount.add(increment) -> Number.plus(amount, increment) [instance method -> class method]) and cull the generated code heavily using a static checker, you might be able to do quite a lot. Of course then you have to deal with the case where the suggestion is subtly wrong (e.g. amount.add(increment) was intended to mutate the amount, while Number.plus is a pure function) and the programmer might not spot it, if they were unfamiliar with the correct usage in the first place. Now we are firmly in research territory, I think.
- inputcoffee 10y agoHere are some ideas for the search space problem: 1. Do it in the cloud somewhere. You probably want to do this anyway so you can learn from everyone. 2. Now you can't indefinitely keep everyone's code in the cloud (as kite is learning), so you take the most common use cases and privacy minded coders can download those to their desktop. 3. Of course languages are constantly evolving so the "cloud archive" will always be live and learning from everyone By the way, you would "learn" a mapping when someone searches for "len, length, .len" and so on but they finally settle on "size" so you would have the input and the correctly labeled target from people's code. You do have to watch them programming in practice though. For the subtle variations, it would hopefully give you a list of suggestions in order of usage.