tags:

views:

167

answers:

7

Empirical question about code: Does the use of autocomplete change one's code? In general, do developers who use autocomplete tend to use longer variable names, for instance, or does it not really change things in terms of the code written?

+4  A: 

One thing autocomplete can do to change your code is to make you aware of functionality inside a given library that you might not have noticed unless you scoured the libraries docs - this could allow for better (more concise) usage of the libraries.

Shane C. Mason
Interesting point
Yar
Shane, thanks for your answer, I would mark it as best answer because you actually answered the question (didn't say, "my coding" or "my code"). I did mark it +1. However, since I am an autocomplete fan, I've chosen an annoying anti-autocomplete answer instead (for intellectual balance). Hope you don't mind, I'm sure you'll get the points quickly elsewhere.
Yar
+4  A: 

I would say that AutoComplete and Intellisense both encourage the use of longer variable names by visual cues and convenience.

However, just because these features encourage cleaner code writing (i.e. longer variable names) doesn't mean that they are used or welcome by everyone.

+4  A: 

I think that auto completes doesn't have impact on code, but auto complete could lead to programming by coincidence, when the programmer try to use one function without seeing the details. And if it works, it's done.

I think that this is one of the collateral effects of auto complete.

Pedro Ghilardi
This could be true if your IDE does not provide doc hints along with the autocomplete - if it does though it could lead to quiet the opposite.
Shane C. Mason
Good point, since the bugs come from moments "one fades away", i.e. distracted. Then auto-completion does the "trick".
Pindatjuh
Interesting stuff.
Yar
Shane, I partially agree with you, but I think that sometimes the programmer is distracted or with hurry and even with a good IDE the coincidence programming can happen.
Pedro Ghilardi
I am marking this as best answer. As you might have guessed, I totally disagree and have only great things to say about autocomplete. HOWEVER, you actually answered the question and didn't talk about your own experience ("helps me," so?). While we're all sort of guessing here, the question was about effects on code, not on YOUR code. Thanks for your answer.
Yar
+4  A: 

I have found that I write longer and more descriptive variable names when I have autocomplete available in an IDE. When I began writing Ruby I started with vim as the editor, and would try to keep variable names below 8 characters or so. When I switched to RubyMine, I no longer worried about variable name length and used much longer names.

Kaleb Brasee
Yeah, they can (and do) force me to use a concise dynamic language (Ruby), but they cannot force me to use short variable names (hence I use Netbeans).
Yar
ViM has autocomplete too and just like most of the things with ViM it's a bit hard to learn but it pays off after a while.
pgmura
Yeah, I figured that vim/gvim has that sort of thing. I only use it for the very basics of text editing. Other than editing and moving the cursor, the /s replace and copy/cut/paste are the only commands I know.
Kaleb Brasee
+8  A: 

I find autocomplete helps me in the following ways:

  1. Autocomplete makes it easier to name things what they should be named, and not what is easy to type. I find myself using more descriptive names for things when I have autocomplete.

  2. Autocomplete also makes me more efficient by freeing me from having to commit to memory large swaths of API. The autocomplete helps jar my memory when I an looking for a particular method or class.

  3. I like to use autocomplete as a form of in-place API exploration. If I know generally what I am looking for, I use the autocomplete to explore what an object does, rather than breaking out of the editor to look something up on google.

Ryan Michela
+3  A: 

Autocomplete is useful for longer variable names but I find it more useful for exploring APIs and such. Also, when it shows the doc hints I find that most useful especially when there are variations on a function/method.

However, I usually refrain for 'excessively' long names because you can't always guarantee that someone else will have autocomplete in their preferred editor. Not to mention occassionally performing edits on a production server (yeah yeah, spare me the lecture) you'll usually be using something like vi if you are on a unix system.

As for really long variable names, I just shorten it but still retain hinting as to what its purpose is. Or if the variable is short-lived (only in a small code block) I'll just use something really short even if its not obvious.

spatel
what lecture? You shouldn't do that, though, you know? :)
Yar
+1 thanks for that.
Yar
+1  A: 

I personally left the longer-variable-names bandwagon years ago. But I still find autocomplete helpful in reducing the number of errors caused by mistpying.

Yes, the compiler will catch this but more and more I find myself using languages without compilers.

slebetman
Why did you leave the bandwagon?
Yar
Because `doesImproveReadability(longerVariableNames) === false`. At least in my experience. Nowdays I tend to `readability.use(varnames(SHORT | MEANINGFUL))`.
slebetman
Probably a good idea, using shorter names. Though abbreviations do suck, eg "bufCntr" instead of bufferCounter
Yar