Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Maybe a little bit off-topic and controversial, but in my opinion auto-complete is overrated.

Doing software development is mostly reading code and documentation. Obviously one also writes code and for sure one can't memorize every function or package name, but searching for it isn't that much of a bottleneck? Some time ago I wrote Java using Eclipse (which had/has reasonable auto-complete), but when I switched to different languages, I also switched my IDE and mostly use plain text editors these days. There are auto-completion tools for text editors, but I just never invest the time to activate or configure them and AFAIK there aren't completion tools which work well across different languages.

Maybe I revisit them at some point, but at the moment I do not really miss auto-completion.



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".


But what if it's called "size"?


It 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.


This 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.


Jedi (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.


or 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


I 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.


Why 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.


You'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.


Allowing 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.


Here 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.


Maybe a synonym aware documentation searching autocomplete?


> searching for it isn't that much of a bottleneck

When I left IDEs for a terminal-based dev setup (Vim + CLI), this was what I thought. I rapidly discovered how incredibly wrong that was.

A big factor, for me, was that autocomplete kept me from making typos. Even with a rapid feedback loop, those typos build up. Plus, the reduced cognitive overhead that comes from being able to bang out code faster also lets me stay much more focused.

Intelligent autocompletion is a nice-to-have that I don't think I really miss, but straight-up dumb autocompletion has been a huge boon for my productivity.


On the other hand, autocomplete leads to typos in the middle of a variable name being repeated again and again. Plus, practice of typo-free editing is beneficial also outside IDE, i.e. for chats/emails/commenting on HN.


> On the other hand, autocomplete leads to typos in the middle of a variable name being repeated again and again.

No. It's programmers' dyslexia which leads to typos being repeated again and again.

The problem is that many programmers don't read their own code, and even if they do they don't know how to read it critically/carefully. It's incredibly frustrating.

There are a lot of similarities between writing code and writing prose. Many programmers are unaware of this. Even today, many programmers write code for machines to execute, not for other people to read. I feel that it's deeply wrong approach and that "creative writing" course (or something equivalent) should be mandatory for programmers.

I think we need a large shift in how introducing spelling and grammar errors into the code is seen. Namely, it should be viewed exactly the same as introducing bugs - it's that damaging in the long run. Please don't do this. Please use spell checkers and please learn your orthography.


For that I have Grammarly plugin


Even if you knew every function in every lib in your head, typing with autocompletion from some good IDE like IntelliJ will make you write code much much faster. And I do not talk about just function name completion (but include them too of course).

Typing just the first or few random letters of veryDescriptiveLongMethodName and completing it with space/tab will always be faster. Using stuff like templates, smart completion, emmet, refactoring tool, constructor/method generators will always be faster, if you know your tools well.


Snippets in Atom is the first time I've ever used any kind of autocomplete, and it seems to mostly just slow me down. If it finds a match on a thing that's at the end of a line, it'll replace what you just typed when you hit enter...changing it from what was actually intended to the snippet. And, even when it's not at the end of a line, I end up context switching a lot more to figure out what just happened and why my text changed.

I feel like with Java it makes a lot of sense to have smart completion, because you end up with incredibly deeply nested identifiers and such. A whole lot of typing. But, I don't code in Java, in the general case (aside from occasionally tinkering with Android APIs, with thoughts to some day making an app). For many more concise languages, it feels like a solution looking for a problem.

I could be wrong. This could be a thing that would provide clear value, if I were to put in the time to learn how to use it correctly. But, so far, I just feel vague frustration when I have the feature turned on.

That said, having docs available as you type is something I can see clear value in. I have to have API docs open 100% of the time when coding...having it jump to the right function as I'm typing it would be awesome. It seems like Kite does this, too, which is probably enough reason for me to use it. I've been poking at Python again lately (after many years away from it), because of Tensorflow and Keras, so I'll give this a go.

I wish they had a Linux version. I rarely work in Windows (though ConEmu and WSL has made it so I'm not terribly unproductive in Windows anymore, as I once was).


We actually almost delayed launch to get linux support in because it's very close to ready. Several of us internally develop on linux and have been using Kite on linux for a while.

Regarding features, there's actually more than just autocomplete and docs: https://kite.com/tour/atom


I actually agree that under many languages/editors it's so difficult and finicky to set up autocomplete that it's not worth doing. We actually think that's a strength of the Kite model where we offload this stuff to the cloud and provide this stuff as a service.


This would rather vary with one's level of expertise. I remember when I was a beginner, I had to rely on the IDE that helped me get onto the speed. Sure there were tons of resources online, but a nick of continuity with the project may go a long way IMO.


Another point to consider is that even if you are a genius expert a lot, if not the majority of the code that people deal with has business specific models that you interact with.

It doesn't matter how well you know library X or the stdlib.

Some made up examples:

userRepository.findUsersWithPlan(planName);

customer.sendPaymentLateEmail(...);

Having powerful IDE assistance reduces the barrier between your thought and the computer.

When I think "send email to customer" I just want the shortest path to achieving that. I don't want to fiddle around or context switch.

Another advantage is that it can guide you into picking the correct option.

I have been burnt many times when looking things manually because you may find one option but not be aware that other options exist.

It's nice for the IDE to communicate to the human "now here's a list of valid things you can choose from".


I don't know if it succeeds at that, but it promises not (only) code completion. It promises documentation, code examples and answers to common questions as well, exactly the kind of stuff you as well say that you do more than actual coding.


I agree, providing context-sensitive example-based documentation would be great, but is also very hard to do without a full-blown parser for every language one supports.



> but searching for it isn't that much of a bottleneck?

If you look up from your text editor even a second, it will take several seconds to get back into context. So even if the page you want is already in your browser, and you just switch windows, you lose. Also autocomplete has three purposes: prevents unnecessary typos, is faster than writing it out, and lets you find API/docs.

How long it takes to find a relevant piece of code in your code base obviously depends on what tools you have for searching your local code, how much code it is and how good the search is. How long it takes you to find something online depends on how good the docs are etc.

How much value autocomplete is also depends on the strength of the type system of course. For C or Javascript there isn't much autocomplete can do with the contextual information, but with Java there is a ton to be gained (Long method names are norm, and object-dot notation feels almost invented for autocomplete). So if I were using something with a functional flavor, or a weak or dynamic type system I'd probably have a different opinion. But for strongly typed OO (C++, Java, C#, ...) the value for autocomplete is enormous to me.

Without autocomplete you can always make longer descriptive type/variable names because the time taken to write a type name isn't proportional to the length, only to the unique prefix or unique camelcase signature of the type name. E.g. for a DefaultUIRenderer I could write DUIR-Tab and know I had the right type (Insert obligatory Java joke about ContextFactoryProviderFactoryDecoratorVisitor here). How much you gain on this depends on how good a typist you are obviously. I have an error rate of around 1/10 chars being backspace, and you might argue it's because I do auto complete, I don't know...

> There are auto-completion tools for text editors, but I just never invest the time to activate or configure them

Me neither. That's why I think any reasonable IDE should be either a) working out of the box. I.e. hope that you can find an editor/IDE that ships with batteries included, or b) that it's at most a matter of selecting one plugin from a menu to activate support for language X in the editor. If I have to start configuring something with a text file somewhere then someone failed, either the makers of the language or the editor or both. Even in "plain" editors like VS code or Sublime you can usually just get a plugin these days.

> AFAIK there aren't completion tools which work well across different languages.

There are efforts to do this, but the name escapes me - that is, an effort to remove N languages times M editors and make a standard for syntax highlighting, autocomplete etc. that makes at an M+N problem instead.


The best attempt to solve this M+N problem is https://github.com/Valloric/ycmd as far as I know. It handles only autocomplete, though; syntax highlighting is apparently not too painful to add.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: