11 ms·
You know, I realize I'm the weird one here, but: when writing code, I almost always turn off autocomplete. Sometimes you basically have to have it on (when the
by OskarS 7y ago
You know, I realize I'm the weird one here, but: when writing code, I almost always turn off autocomplete. Sometimes you basically have to have it on (when the language is demands it) but I usually turn it off. It's too much visual noise, too distracting. It's a thing that pops up that demands your attention. If I want to type
if (myVector->empty()) {
fillVector(myVector);
}
autocomplete will pop up a window like 4 times while writing. For no real reason: i can type "empty()" on the keyboard faster than I can look at a screen and choose "empty()" from a list, and having having the list pop up is distracting.
In fact, I strongly disagree with this:
> If I were writing a sophisticated user interface today—say, a programming language or a complex application—autocompletion is one of the primary constraints I would design it around. It’s that important.
Ugh, no, I don't like this at all. This is what leads to nightmarish Java type names ("AbstractSingletonProxyFactoryBean") that makes this language practically demand auto-complete. A programming language should be easily typeable on a keyboard without having to resort to auto-complete for everything.
- knubie 7y agoI'm right there with you. But there are alternative interfaces for auto complete. I personally prefer the "autosuggestion" style used in fish: https://fishshell.com/assets/img/screenshots/autosuggestion.png https://fishshell.com/assets/img/screenshots/autosuggestion....
- utxaa 7y agoi threatened to quit a job because they forced fish on us. it is so distracting that i can't think when using it. they allowed a bunch of us to go back to bash.
- SketchySeaBeast 7y agoI'm a bit confused - isn't autocomplete utterly benign if you don't use it? Using Visual Studio I've never had to autocomplete unless I wanted to, so I've lost no time by having it on if I just want to trudge through, but there's plenty of times I can auto-complete away whole expressions by typing a letter or two and then hitting tab. Regarding nightmarish Java type names I'd rather the name for things be the fully written out description (like "httpClientFactory") than something that's easier to type - at a glance I know what it is and does, and autocomplete is smart enough that I can type "h" and tab and it has the variable there already. And if I don't know what it does, all that takes is a "h", a tab, and a ".", and now I have access to all its functions with descriptions, saving me a context switch and jump to the documentation.
- OskarS 7y agoI'd argue that it's not benign. I think there are very real costs. First off all, "misuse" of autocomplete can be very annoying. Some autocomplete system autocompletes when you press tab, some when you press enter. Many times I've been typing a thing, finished the line with the autocomplete window still open, pressed enter to go to the next line, and instead have auto-complete enter a bunch of stuff I don't want. These kinds of annoyances go away if you learn the system properly, so it's not a huge deal, but it's there. More serious is the visual noise. I type while looking at the screen, and having a window pop up like that is distracting. It forces attention to itself since it's right next to the cursor (which is where I'm focused), and you have to process it. There's a reason people build elaborate "distraction free" practices, and we all know that being distracted by sudden inputs can break "programming flow". Auto-complete does this for me. It's not that I can't work with it, I just feel much more focused when not using it. Like, imagine if auto-complete was enabled when writing just regular English. Every time you get half-way through writing a word, a window pops up suggesting that the ending of the word "parli" is probably either "parliament" or "parlimentary". That would be super-annoying, right? There's a reason Microsoft Word doesn't have autocomplete in this way, and it's how I prefer to program. Third, I do think there's a more insidious effect of over-reliance on auto-complete. I genuinely think it leads to bad practices when designing a language, because you come to rely on it. Type names and lines become longer and you start to use more inline namespaces. I think of C++ chrono library as an example of this. It seems like a library entirely designed to be used with autocomplete, because no sensible human without autocomplete would design a library like this: auto start = std::chrono::high_resolution_clock::now(); // .. do stuff auto end = std::chrono::high_resolution_clock::now(); auto elapsed = std::chrono::duration_cast<std::nanoseconds>(end - start).count(); I think (but am not sure) that's the correct std::chrono way of measuring a duration and get the results in nanoseconds. That's just an example, and you can argue with it, but I feel like auto-complete encourages this style of programming, and I don't like it. I don't like to type it, and I don't like to read it. Again: I know I'm the weird one. Tons of programmers I've worked with and respect love auto-complete, and for good reasons. But I think there's a downside that most people don't consider, but maybe should.
- gbear605 7y ago
- sk0g 7y agoBut they're customisable, if you can be bothered. I have set up a few as is, and some defaults are really handy too! For example, `err.nn` expands to ``` if err != nil { } ``` And that's a default for GoLand. I have set up a few custom ones that are pretty handy as well, which frees up time from typing, to actually thinking through and solving problems, as well as making any necessary verbosity easier to deal with. While most variable names are kept short, I do go for 2-3 word variables when necessary, and have some pretty long winded function names that, IMO, improve readability by a mile, like `GetNonEmptySliceElements()`.
- jasonlotito 7y agoMost auto complete that I've seen implemented in the last decade has timing attached to it. So if you are typing empty(), it's not just going to pop up. Rather, it waits for a pause, an indication that you aren't sure. I also don't know of a single language that requires auto-complete for everything. I do know languages that make more use of it, but I also don't now of a single language that benefits from not having some form of autocomplete. Even your myVector example could benefit from autocomplete (either having a better name them "myString" or "myInt" or me just typing 3 keys instead of 8 for completing myVector. Do bad interfaces exist? Sure, I don't know of a single UI element that can't be done poorly or messed up.
- manaskarekar 7y ago> if you are typing empty(), it's not just going to pop up. Rather, it waits for a pause, an indication that you aren't sure. That's a negative experience for me. If I'm pausing, it's because I need to think about something. In that instant, a suggestion distracts me. The chances of the suggestion being relevant to my pause are pretty low. The best option is when you can invoke the autocomplete/docs on demand - using a convenient shortcut.
- jasonlotito 7y ago> That's a negative experience for me. Sure, I wasn't talking to you. I was referencing another user and a specific element of their comment. I also wasn't giving an exhaustive list of all the options available in modern autocomplete features. > The best option is when you can invoke the autocomplete/docs on demand - using a convenient shortcut. Autocomplete has that as well. Seems like people are assuming that there is only one way to do things, which is silly. Instance, delayed, and activated. These all exist. So yes, you can customize things to fit your easily distracted nature.
- seanmcdirmid 7y agoI find that the timing is actually worse, because then I start waiting for the menu to appear as affirmation for some assumption I made about the namespace. It’s also jarring that it appears out of sync with keystrokes. Turning off the delay and working on menu placement instead could provide for better PX, but it is something that can be user tested a lot, at least.
- namdnay 7y agoI think it depends which objects you're manipulating. I remember that autocomplete was the best thing since sliced bread when trying to manipulate UI objects in VB6
- melling 7y agoThere are lots of developers like yourself. I always refer to this as the John Henry Programmer. https://www.ibiblio.org/john_henry/ https://www.ibiblio.org/john_henry/ Just bang away at keyboard as fast as you can, hitting keys tens of millions of times over a lifetime. Humans are tool builders. At some point, the tools will mature to the point where sudden bursts of typing at 100 wpm will become irrelevant.
- setr 7y ago>Humans are tool builders. But they don't always build useful tools ! And more notably, useful tools don't necessarily become widespread, and widespread tools aren't necessarily useful And of course widespread tooling is often not actually best-in-class But so human advancement is not sufficient reasoning -- it's not uncommon that doing nothing at all is more optimal than doing the thing we did (eg the recent flight boarding article on frontpage, which described the common back-to-front, and front-to-back, load orders being worse than random load -- the optimal solution is quite convoluted)
- cytzol 7y agoI used to think this way, too, so I don’t think you’re weird. At my old workplace, everyone else was a Java IDE wizard, and I was used to good old-fashioned text editors. Aren’t you distracted by that widget appearing while you’re typing, I thought? Is it really faster for you to hit the Down arrow three times instead of just typing ‘empty’? Do people not learn the libraries they’re using anymore‽ But over time, something changed, and I’m now a big fan of autocomplete interfaces. There was something wrong with my initial assumptions, and I think that’s the same assumption you make when you say this: > i can type “empty()” on the keyboard faster than I can look at a screen and choose “empty()” from a list You’re right, I can type ‘empty()’ faster than selecting it from a list. I have the muscle memory already there, and I don’t need to stop and look and think about which method I’m autocompleting. The reason I still use autocomplete is not that I need my IDE to tell me that there’s an ‘empty’ method there as if that’s something I don’t already know, but to tell me that my assumption that ‘myVector’ has an ‘empty’ method is correct! I occasionally write code like this: auto myVector = someFunction(); if (myVector->empty()) { fillVector(myVector); } Only to find that ‘myVector’ is not actually a vector, but an optional<vector> or another type entirely that requires me to do something else to get the vector I want. At this point, if I start typing ‘empty’ and the autocomplete widget does not appear, I immediately know that I’m not dealing with the type I thought I was. Once I started programming this way, having the window appear was not ever a distraction, because I expected it to appear. In fact, the only distraction was when it stopped appearing, when I’ve made a mistake!
- ehnto 7y ago> The reason I still use autocomplete is not that I need my IDE to tell me that there’s an ‘empty’ method there as if that’s something I don’t already know, but to tell me that my assumption that ‘myVector’ has an ‘empty’ method is correct! Exactly, autocomplete is an excellent discovery tool. I may not even be aware productModel->hasConfigurableOptions was a function, or Product\Model\Configurable\Options was a model until I check with autocompletes.
- bradstewart 7y agoThis. I find it's even more valuable with the explosion of 3rd-party libraries and packages--I'm constantly interfacing with code I didn't write, and autocomplete is _way_ faster than context switching to look at the docs/source of a library.
- seanmcdirmid 7y agoAutocomplete doesn’t have to be so intrusive, it doesn’t have to pop up a window over your cursor, it doesn’t have to grab CPU time making your keystrokes skip. These are really interface issues that can be fixed: you can shove the suggestions off to the periphery of the buffer, for example. Autocomplete is and was never about saving on typing. It is an aide to help you browse and navigate large namespaces, it doesn’t enable long names, it enables deep and vast libraries. The complaint then isn’t about some straw man class name, but about the 200+ methods that can be called on that class.
- ehnto 7y ago> Ugh, no, I don't like this at all. This is what leads to nightmarish Java type names ("AbstractSingletonProxyFactoryBean") that makes this language practically demand auto-complete. You have it the wrong way around. Naming like that comes from the structure of the application, which just happens to benefit the ability for autocomplete tools to understand it. If you've ever worked on enterprise software, with hundreds of classes across a half a dozen domains, you'll know the structure comes from a need for organisation and discoverability, and without that organisation you would have a harder time finding the parts of the application you need to be aware of. Autocomplete is just a convenient way to search the codebase for what you want. But that structure is the real hero.
- lgessler 7y agoI don't think there's anything inevitable about AbstractSingletonProxyFactoryBean. This absurd design pattern has its roots in Java's misguidedly restrictive approach to abstraction, which all but requires classes and inheritance to be the primary units of abstraction. More graceful abstractions are unergonomic or impossible since Java was not designed e.g. for higher order functions. The requirement that everything be in a class and the ontological awkwardness that often ensues when some conceptually non-object-y entity must be coerced into an object results in a lot of incidental complexity.
- eitland 7y ago> ontological awkwardness that often ensues when some conceptually non-object-y entity must be coerced into an object results in a lot of incidental complexity. Is it really that hard to create a Helpers class with static methods? I'm back on Java now after a rather long detour and I say I happily accept the verboseness of it for - the niceness of having a IDE that can almost replace pair programming - an ecosystem were dependency resolution works
- tlarkworthy 7y ago> an ecosystem were dependency resolution works My coffee just shot out my mouth.... What? Java --> Diamond dependancies --> Install fickin' maven plugin to print dependency tree --> pray that clashing dependancies converge at some version combination, and that does not cause another issue in a different pair of dependancies (and that I don't have to rewrite my project too much). I really like that nodejs can handle diamond dependancies. sidenote: I do like the simplicity of Java code though too.
- reaperducer 7y agoI almost always turn off autocomplete I treat it like eye candy: Just some fun, animated blandishment that makes me feel all 1337 while banging out code. What would be nice is if the auto-complete window could be detached from the cursor and float in a corner of the editor, so I can look at it for those times when I have a brain fart and can't remember which parameter comes first in a function.
- 098799 7y agoEmacs + company + posframe to the rescue.
- hyperpallium 7y agoIn vim, you have to ask for autocomplete (^n).
- lubujackson 7y agoI agree, personally, but I am sure it is a minority perspective. I worry it might just be my unwillingness to change habits and workflow. If I am writing down functionality I usually want to complete my thought first, sometimes even in meta-code, then go back and make it proper. Like you say, autocomplete interrupts with several micro-decisions per line. But I grew up coding in Notepad, so most editors feel like another part of the complexity stack I have to manage. Other devs seem to code with autocomplete almost like they are coding with a visual programming language. They use the mouse a lot more or keyboard combos if they are really efficient, but they anticipate autocomplete results and select variable names quickly, partly with a mental inventory of variable name options. I think there are clear strengths to both methods. Pro-autocomplete devs seem to naturally follow the single responsibility principle (SRP) while I find that level of scaffolding obscuring at times.
- dmortin 7y ago>Sometimes you basically have to have it on (when the language is demands it) but I usually turn it off. It's too much visual noise, too distracting With a proper tool you can configure if autocompletion pops up automatically or only if you request it with a hotkey. Check your tool if it can do this. If not then look for a better one.
- hota_mazi 7y agoNot all auto completions are equal, I suspect you've only dealt with bad ones. It's very tricky to get right and requires a lot of attention to detail in timings, human attention span, UX, and even psychology. IDEA's auto completion is mostly good, in my experience, not sure if you've tried it. > i can type "empty()" on the keyboard faster than I can look at a screen and choose "empty()" from a list, Sure, but that's a five letter word with no camel case nor special symbols. Your observation stops applying very quickly as the code base grows. Not mentioning that having to type all these letters and symbols (especially if you need to use the shift key) is pretty bad from a carpal tunnel standpoint.
- city41 7y agoI prefer autocomplete to only appear when I ask for it. Often that is ctrl+space. It's a good compromise between the two extremes.
- wavefunction 7y agoPerhaps you would benefit from a customizable latency on autocomplete, similar to what I've implemented when building autocomplete form fields. You don't want stuff popping up with every key press or even as someone is still typing and presumably understands what they want to type next. If you could customize the lag after ceasing to type a key and match it to your normal typing cadence I imagine your experience and utility from IDE autocomplete would be much greater.
- baddox 7y ago>This is what leads to nightmarish Java type names ("AbstractSingletonProxyFactoryBean") that makes this language practically demand auto-complete. I suppose this is really just a matter of opinion, but it seems strange to argue that autocomplete is bad because it can be so useful that you'll definitely want to use it. Sure, it's a separate argument whether "Factory" and "Bean" are useful, but long, verbose, meaningful names are good in my opinion. A random example taken from the React source code: `attemptHydrationAtCurrentPriority`.
- jodrellblank 7y agoattemptHydrationAtCurrentPriority Without knowing anything about React or what Hydration is, I’m suspicious of this name - “AtCurrentPriority” doesn’t sound like useful information, everything should happen at current priority otherwise what does the concept of a “current” priority mean? In a shell you don’t list files in the current directory with “ls —in-current-directory”, because the current directory is what you get if you don’t specify anything. Similarly, in a language with exceptions and a library with error results, “attempt” is a non-description; everything is an attempt by default, the interesting things might be things which somehow can’t or mustn’t fail. This smells like it ought to be “Hydrate” and then have a version which can be specified at some other priority if that’s needed.
- thisgoodlife 7y agoChoosing an item from a list is not the right way to use autocomplete. IMHO, autocomplete is a good way to make sure you don't have typos. I never choose from a list. I always type enough letters to make sure the current one is the one I want and then hit tab.
- deckard1 7y agoWhat's often missing from these discussions is the impact on human memory. Back when I started programming, I never used syntax highlighting. It just wasn't a thing for a large part of my early years. Text mode VisualBasic and QuickBasic didn't have it. Nor did GW-BASIC, QuickC, Pascal, I could go on... I was at the point where I could write C code and have it compile the first time. No syntax errors, no compiler errors, full -Wall and -pedantic. After using an IDE for awhile, I noticed my ability to get things right diminished. I gave up knowing things for relying on technology. One area I notice this the most is spelling. I used to be able to spell. Now I critically depend on browser or editor highlighting of errors, or throwing a word into Google to see what Google tells me. And it's not just new or complex words. It's words that I used to know how to spell. If all I had were pen and paper, I would be helpless. Some will say technology frees you to memorize other more important things. But the downside is you give up agency. And very well may just become that much more of a replaceable cog in the machine.
- jonhohle 7y agoI tend to agree with this line of thinking. I've been almost exclusively a Vim user for the past 15 years and feel like, if anything, it's made me a better programmer because I do spend a lot of time reading docs and code, refining my mental model of APIs, and often, thinking through problems before I start typing since I know that all of the characters in the file will come from strokes of my fingers. There are certain classes of autocomplete bugs that just can't happen when you're typing every #include/import/require that I find myself continually cleaning up and writing static analysis for. I spend far more time reading other people's code than writing it. Autocomplete doesn't provide any assistance there.
- strokirk 7y agoIn what way does vim help here? It has all kinds of Syntax highlighting and autocompletion, and it's not like you can't disable it in other browsers.
- scarface74 7y agoWhen I first started, I spent all of my time writing C at my keyboard with few interruptions. Two decades later, at any given time, I’ll be writing C#, Python, Javascript, yml for CloudFormation, a litany of third party external dependencies, internal libraries written by developers on multiple teams, etc. Not to mention “polyglot persistence” dealing with Mysql, DynamoDB and ElasticSearch. All that and Zi purposefully avoid the front framework of the week. The scope of what I am expected to know changes.
- gumby 7y agoI agree, and it's part of the heavyweight interfaces of a lot of these modern tools. For example, search is my primary cursor motion command in Emacs, because it's incredibly lightweight and typically faster than any other cursor move command. Whereas invoking search in many programs from word to IntelliJ will move the cursor and focus away from where you're working to some widget elsewhere, and often requires a confirmation to perform. Incremental search is finally appearing in some browsers, bringing them into the 70s. But just as software itself has seemingly gotten slower as the machines have sped up, I feel like the interfaces have gotten significantly more cumbersome.
- utxaa 7y agoswiper?
- eitland 7y agoSomewhat less serious suggestion, not aimed at OP, but this whole thread: How about everyone with less than two years experience with both IDEs and editors stand back so we grown ups can sort this out ;-) On a more serious note and as someone who has been on both sides of the fence: How about we accept that people are different? Some people like Mac, some like Linux and some - gasp - enjoy their Windows desktop. That said, and as someone who has extensive experience from both sides, I think that if people put the same effort into learning and configuring their IDE as they put in learning and configuring vim then that might very increase productivity a lot more than last ten years worship of vim. (And: do learn a bit of vim. It comes in really handy sometimes, just don't fall for the idea that some people sell that you cannot become a good developer without using it all the time.)
- deleted 7y ago[deleted]
- tolmasky 7y agoI am in the same boat, but was recently told I program very differently than most people. I write a bunch of stuff that does not attempt to be syntactically correct (everything from while(???){ } since I don't know what the exit condition is yet, to straight up interlacing "a --> something --> b" or random ascii drawing of trees, in the middle). To me code is very similar to writing an essay, especially at the beginning, I'll have random lines all over the place as I develop the idea, and only reign it in to something that will actually run much later. For this reason, I also am totally OK without syntax highlighting often. My editor of choice has a bug where it often won't syntax highlight on the creation of a new file and you have to manually reselect the language. I actually like this and treat it like a feature: new files start in "brainstorm mode" and only "earn" syntax highlighting once they are sufficiently mature, at which point the environment becomes more constrained. This kind of accidentally mirrors the behavior of CodeWarrior which I used to love for C++: before the age of running a daemon in a parallel process to syntax highlight, CodeWarrior would only "know" the classes and methods you defined on the last successful compile. This was simple and fairly bullet-proof: no need to clear any weird caches or anything, no crashing background thread trying to highlight incorrect code, new classes were unrecognized until you hit compile. That being said, even if I programmed with the intent of continuing to be syntactically correct during the entire process (which I do when I am editing an existing file usually), I still cannot stand autocomplete, or really anything beyond simple syntax highlighting, because I feel like everything about today's computing experience is yelling at me. Notifications constantly popping up, linters yelling about stuff I don't care about yet, and autocomplete acting like clippy telling me every possible method that starts with an S. I find it severely distracting. I wouldn't want Microsoft Word to tell me every verb that starts with "s" just because it knows that in this position of the sentence I must be typing a verb and I just hit an "s".
- jcelerier 7y ago> For no real reason: i can type "empty()" on the keyboard faster than I can look at a screen I just checked my key sequence for writing that : if<ctrl+space><enter>myv<enter>.em<enter><down arrow>fill<enter>myv<enter><right button>; At no point I had to "choose" from a list from screen - if I have to I just type the next letter until what I want is accessible under <enter>. It's most certainly faster for me to press a single enter when it does than the four remaining letters, and the parentheses
- scarface74 7y agoEasily typeable often comes in conflict with easily comprehendable. I would much rather see long descriptive names than a lot of comments.
- arduinomancer 7y agoYou're doing it wrong. The way most people use it is they type enough letters to be specific enough then hit tab to fill in the rest. For example in intellij I'd type something like "my" then hit tab immediately.
- edwinyzh 7y agoAuto-complete is at least very helpful in two regards: - "Don't make me think". I don't want to wast my brain bandwidth on remembering the details of tens of thousands of the methods/properties/functions, but instead on the logics/architecture/communication of the app I'm building. - Method/property discover-ability, especially for new classes/interfaces/libraries.