Hacker News new | ask | show | jobs
by imran-iq 982 days ago
I also don't like autocomplete. The reason being that not having it actually forces me to learn the libraries I am using.

> You know everything by heart?

You eventually reach that point. Do you still look down to see which keys you are typing?

This is also has the nice side effect of pushing you to use libraries that are stable and have good documentation as you can always reference them if need be.

2 comments

My memory is a leaking bucket. My typing however, is very fast.

Take for example the substring function. I wouldn't know which one it is for JavaScript, Haxe, ActionScript3, C#, Java, Python, C, C++, PHP. I know I used it at one point for all of them.

For languages like JavaScript, Java and C#, it's probably a method, so you can start typing. Might be substring(), might also be substr() or something like that.

For Haxe, I thought it was not a method so I think it's either part of Std or StringTools.

If I use autocomplete, I have it in a few seconds, and I can also see the documentation on the parameters. Is the second parameter an index or a length? To be honest I have no idea. And the good part is, thanks to autocomplete I don't need to know.

Also, if you work in a big codebase, you can't know every class. Needing to dig through code seems such a waste of time.

> For languages like JavaScript, Java and C#, it's probably a method, so you can start typing. Might be substring(), might also be substr() or something like that.

In JavaScript, there are both, and a third one besides, largely for reasons of historical accumulation and inconsistent implementation:

  String.prototype.substr(start, length?)
  String.prototype.substring(start, end?)
  String.prototype.slice(start, end?)
They’ve each got their strange nuances in behaviour (and, in so-ancient-you-certainly-don’t-care-about-them engines, cross-engine inconsistencies), so if you’re relying on autocomplete, it’s necessary that your autocomplete at the very least give some meaningful parameter names, because the difference between taking length and an end index is rather significant.

Which one should you use? slice. It’s generally agreed to be the most reasonable of the three in what it does and how it works, and it matches Array.prototype.slice well. So: sorry that you thought it might be substring or substr, because those exist but you probably shouldn’t use them.

(Related reading: https://stackoverflow.com/questions/2243824/what-is-the-diff....)

> My typing however, is very fast.

This is because you can remember where the keys are.

> For Haxe, I thought it was not a method so I think it's either part of Std or StringTools.

How would autocomplete help you here? If you need to know if it was a global function or else where? This is learned knowledge that is available through the proper docs and not through autocomplete. This is how you know not to look for a global function. The difference is that instead of reaching for autocomplete to try and fill in the gap, I go to the documentation. I basically share the same feelings/experience with this comment[0]. Either I know what I am doing and I do not need autocomplete, or I need to learn in which case autocomplete just gets in my way and I would rather go to the docs.

I know I am not alone in this, for example I watch the lead developer of pidgin, Gary Kramlich, on twitch[1]. He does not use autocomplete, any time he has to look something up, its straight to the docs.

Similar with Jonathon blow[2], who is working on his own game, game engine, and language who just uses emacs (with no autocomplete) and visual studio for the debugger.

And even Mitchell Hashimoto[3], who has a similar workflow of using a dumb editor and then going to the docs when needing to learn.

> I can also see the documentation on the parameters. Is the second parameter an index or a length?

The documentation on a per function basis does not contain enough information on how to use the library/framework. Take for example django's QuerySet aggregate function, would you learn enough from reading the function documentation here[4] on how to use it or from the actual documentation here[5]? Autocomplete wont give you anything close to the latter.

> Also, if you work in a big codebase, you can't know every class.

The classes you don't know are just one "goto definition" away.

> Needing to dig through code seems such a waste of time.

Needing to juggle through the autocomplete menu is a waste of time as you need to know _something_ for it be useful. It doesn't help you when you know _nothing_. I'd rather just go straight to the documentation or code.

---

0: https://news.ycombinator.com/item?id=37768953

1: https://www.twitch.tv/rw_grim

2: https://www.twitch.tv/j_blow

3: https://www.youtube.com/watch?v=rysgxl35EGc

4: https://github.com/django/django/blob/main/django/db/models/...

5: https://docs.djangoproject.com/en/4.2/topics/db/aggregation/

> This is because you can remember where the keys are.

No I don't remember, it's automated, like riding a bike. (Edit: for example if I need to tell you where a certain key is, I cannot bring it up from memory, I have to virtually type it in my head with my fingers, and then I know. So this really shows it's really muscle memory)

> How would autocomplete help you here?

Worst case scenario, I type "object.subs", wrong "Std.subs", wrong "StringTools.subs". Faster than you can bring up any doc.

> Either I know what I am doing and I do not need autocomplete, or I need to learn in which case autocomplete just gets in my way and I would rather go to the docs.

What about when you partly know, like substring?

Plus, how does it "get in the way?" You partly type it, and when you see it, you just press space or whatever completes it. Even in typing it's faster, because a good autofill even uses word distances for matching.

> who just uses emacs

There's the problem! ;)

> Needing to juggle through the autocomplete menu is a waste of time as you need to know _something_ for it be useful.

This is exactly it. Most of the time, you know something or at least can take a quick guess. If you fail there are still the docs. You and the other person are very explicit in "either you know it or you don't know it". For me, most of the time, I kind of know it. Probably the main difference is there.

Anyway, good thing nobody is forcing us to use anything, so we can both be happy in our own workflow :).

One question though: have you used Github Copilot and what do you feel about that? It would seem to me you would also feel it gets in your way.

My working memory has limits. I consume and use a lot of information on an ongoing basis. The contextual shift from codebase to codebase is already large, add in a language change and I would venture to say that most people need a little assistance to make sure they remember syntax and specific method calls.