Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Possible Duplicate:
Should newbies use IDE autocomplete (Intellisense)?

I have a friend at school who wrote a program in VB.net in notepad, took it home fixed any errors that came up, and then compiled it. He used a textbook to get the hang of the relatively basic methods and properties he'd need (nothing complicated like network sockets etc) and then wrote it without looking much up.

This makes me wonder if it is frowned upon to use or rely on autocomplete? In Objective-c the method names are quite descriptive, and mostly I know what I want to do and now roughly the name of the method I want to use, though not necessarily letter for letter.

I could, if I wanted use the Documentation or headers to find method names, and I do sometimes. But naturally this is slower.

So should I focus more on learning parts of the language, than actually programming for a while, or is it ok to use Auto complete a lot?

Also as a subquestion, is better to know one language without much autocomplete needed. or to rely more on autocomplete and be able to use other languages (although not as efficiently and easily) once the syntax is understood.

share|improve this question
49  
Using auto-complete I can write more code before I die. I would like to think that this is a good thing. –  Job Oct 15 '11 at 17:30
5  
As wrong as using sticks on a drum kit instead of your bare hands. ;) –  Joren Oct 15 '11 at 20:04
11  
Auto-complete is a reasonable response to long, descriptive names. –  rwong Oct 15 '11 at 20:48
3  
@Job, more != better. If someone tells me, that he wrote 50 kbytes of good code, and I wrote only 5 kbytes, I'll be only more sure, that my code is more debugged. –  Nakilon Oct 15 '11 at 21:23
3  
Isn't the whole point of having computers is to make ourselves more efficient? If not, then forget code analysis or profilers. –  surfasb Oct 15 '11 at 22:37
show 6 more comments

marked as duplicate by Aaronaught, Mark Trapp Oct 16 '11 at 20:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

15 Answers

The tools are there in the IDEs for a reason. As Sean pointed out languages (especially .NET ones) come with extensive class libraries that you cannot hope to remember (despite what interviewers would want you to believe). Would you expect a word processor to come without a spell checker?

With auto-complete you are more productive as you can find the list of available methods/properties/events etc right there in front of you. Otherwise you'd have to either remember (which we've already established is hard) or go and look it up. Both of which take time, thus slowing you down.

You still have to know which of the available methods/properties/events is the correct one to use in the circumstances - no IDE can (yet) write the code for you - that's where your skill as a programmer comes in.

share|improve this answer
2  
A good example is with vectors and strings in C++. Vectors use .size(), and strings use .length(). I usually have trouble remembering that. –  Maxpm Oct 15 '11 at 19:39
7  
The spell checker analogy is wrong imo. It IS frowned upon if you don't know how to spell a word, and this is because you may need to write it somewhere that doesn't have a spell checker (such as on paper, or computer programs whose main purpose is not being a text editor, such as a web browser). Not remembering the method names is instead OK because writing them outside the IDE is extremely rare. –  Andreas Bonini Oct 15 '11 at 21:20
    
@Krelp - It is a bit of a stretch - but I was using it as an example of a tool that it's generally considered useful to have. Yes you are more likely to write outside of a word processor than code outside of an IDE (well in most languages) but even Chrome has a spell checker for text input boxes (like this one). –  ChrisF Oct 15 '11 at 22:08
2  
As Einstein said "Never remember anything you can easily look up" –  ChrisFletcher Oct 16 '11 at 12:49
    
@maxpm: Both vector and string have a size. Supporting a size method is part of being an STL container, which includes std::basic_string. std::basic_string::length is just an alias to size. –  Billy ONeal Oct 16 '11 at 20:14
add comment

I don't think it's frowned on. These days most languages come with a large expansive class library (or two!) and having to commit the exact name, and sometimes casing, isn't always necessary. Plus, multiple overloads on a method make this even more cumbersome.

At the end of the day you've got to understand what you're calling/doing. Auto-complete won't help here.!

share|improve this answer
2  
In some IDEs, autocomplete will help with your last point (since it'll also bring up documentation). –  Brendan Long Oct 15 '11 at 20:15
    
@Brendan: Still won't actually aid understanding; a lot of documentation is pretty terrible. –  Donal Fellows Oct 16 '11 at 20:21
add comment

A few years ago I had to let a programmer on my team go because he insisted on using a text editor rather than the .NET IDE. To be fair, the real reason was that he was slower getting his tasks done and his code was poorer quality and caused integration problems. It's possible that some programmer-savant could have done a better job with just a plain text editor but most of us regular folks need help like auto-complete and speling and grammer checking.

As I like to say, don't bark when you can hire a dog to do it for you.

share|improve this answer
6  
Speling & grammer? I get your point, man. –  cschol Oct 15 '11 at 21:50
1  
I don't see how this answers the question. Also, you seem to be saying his code was poorer quality because he didn't use auto-complete. If that's actually what you mean, your definition of quality might be too low. –  Greg Hendershott Oct 15 '11 at 22:54
1  
@GregH - It was poorer quality because he didn't use the tools built into the IDE that would have enhanced his performance as well as working in better harmony with the rest of the team. Built-in automatic syntax checking was probably a bigger part but this kind of goes hand in hand with auto-complete in Microsoft IDE's. –  jfrankcarr Oct 16 '11 at 0:48
add comment

It is wrong if you need it to code. It is perfectly fine if it something that help you to be more productive.

share|improve this answer
    
What exactly do you mean if I need it to code? Before I write code I can see where I want to go. –  Jonathan. Oct 15 '11 at 17:26
6  
Well, can you write code without it ? If you can't, you have a problem. –  deadalnix Oct 15 '11 at 17:38
    
the reason I ask is that I don't understand how you can write code with auto complete, if you don't know how to program. If I stuck my brother in front of the IDE, he could use the auto complete, but wouldn't be able to program. –  Jonathan. Oct 15 '11 at 20:14
1  
@Jonathan Of course you have to be able to program. But keeping all the names in your memory is neither necessary nor very useful. That's where autocomplete helps, especially with fluent interfaces. –  maaartinus Oct 15 '11 at 22:47
add comment

I'm old enough to remember when autocomplete made it into my IDE.

It made me explore much more sourcecode than I ever did before. Because of that, I strongly believe it made me a better programmer.

share|improve this answer
add comment

School is different from the real world. I would only use it at school if it was going to be available during your examinations. In the real world, there's really no reason not to. It's like relying on GPS when you move to a new city. It takes you longer to learn how to get around without it, but you still do eventually, and you get lost a lot less in the meantime.

share|improve this answer
    
Well that particular program wasn't for an exam or anything, and in exams we get given an IDE of sorts, (I don't believe it has auto complete, but what you're meant to know is very limited) –  Jonathan. Oct 15 '11 at 18:20
3  
What I mean is if you won't have autocomplete on exams, don't use it in assignments. Typing it all out helps stick things in your brain better. –  Karl Bielefeldt Oct 15 '11 at 18:41
add comment

I absolutely wouldn't be without Eclipse's fantastic autocomplete.

  • It helps you navigate your way round obscure APIs (Is it .put(), .add(), or .addElement() to add an item to an ArrayList? What's the order of the parameters to System.arrayCopy() again? Either navigate to the appropriate documentation page, or press Ctrl-Space to view a quick list of all methods available).
  • It slashes down the amount of typing you need to do (System.out.println() vs Sysout+Ctrl-Space)
  • It lets you know instantly if you've made a mistake. If the autocomplete stops working, it's a sure sign you've gone wrong somewhere.

All of these things combine to make for a very productive environment for software engineering.

share|improve this answer
    
Good points, but seriously: you can't remember how to add an item to a List? That's not an "obscure" API, it's one of the most commonly used interfaces in the standard library. –  Daniel Pryden Oct 16 '11 at 2:35
    
Yeah bad example maybe, but I spent a long time coding for J2ME, where the only collection-style API is a vanilla Vector, no generics! So forgive me for always trying unsuccessfully to use .addElement() ;-) –  funkybro Oct 16 '11 at 9:27
add comment

I've seen people only being able to code by auto complete and try and error. That's bad because since they don't understand what they do, they can't solve anything beyond toy problems.

In all other cases anything helping you being more productive is a clear win.

share|improve this answer
    
Were they professional programmers? I can't believe it actually happens... –  cji Oct 15 '11 at 21:20
    
Of course the all other case is the norm. But the exceptions exist. –  Jürgen Strobel Oct 16 '11 at 0:27
add comment

To offer what seems to be a contrarian view:

Remembering: A language library that is sufficiently "random" that you need auto-complete to help remember which method to choose (e.g. is it size or length?), is broken. Would be better to fix it, than to band-aid it. If you can't fix it, wrap it. (If you don't know what it means to wrap it, learn that.)

Typing: Already know exactly the name you want, and claim you're using auto-complete purely to "save keystrokes"? That seems to make sense, although just typing the name is faster than reaching for cursor keys or gods help you the frakking mouse. (If the name really is that long, see above: Fix it or wrap it.)

Programmers who can't type fast are like kids who want to be NBA players but can't make free throws. It's a basic skill you must have. It can be improved if you care and you aren't too lazy to practice.

Obviously there are many mediocre programmers and ball players. Is being mediocre "wrong", as the question puts it? Maybe not. But my answer is aimed at people who aspire to being more than "not wrong", i.e. to doing more than not-sucking. Which I think was the spirit of the question.

share|improve this answer
    
Thanks :), off-topic, but wrapping means creating another library (or another set of methods) that uses the methods of the first library, and makes them easier to use. (e.g. there are c libraries which are wrapped to make them easier to use in higher level languages, like objective-c?), would that be correct? (wouldn't that make the program less efficient when running, albeit (and generally) not by much. –  Jonathan. Oct 15 '11 at 23:24
    
In any given app, you're using some very small subset of a lib or framework. To write some "layer" of your own, that the rest of your app uses, can pay off in many ways. Beyond just remembering the names: It can let you work at a level that fits your app's problem. It can even make it easier to switch libs or frameworks someday. Unless your app is some small one-off utility, the work to do this is usually worth it, IMHO. But ironically, people dependent on a-c might be reluctant to do this because their layer won't have the auto-complete support they "depend" on. :) –  Greg Hendershott Oct 15 '11 at 23:30
add comment

Remember that a language and a framework are two different things. None of the languages that I can think of have so many syntactic forms that a programmer with a bit of experience should have trouble remembering them.

Modern application frameworks, on the other hand, tend to have dozens or hundreds of classes and thousands of methods. You might be able to memorize all that if you really want to, but it'd be a lot like doing The Knowledge minus the licensing exam.

Don't use your IDE's autocompletion as a crutch -- you should work toward a solid understanding of the classes available and the methods they offer. If you have to pause every time you type NS or UI in Xcode and spend time looking at the list of options, you should spend some time with the docs. But there's nothing wrong with letting the compiler complete names for you if you know basically what you're doing.

share|improve this answer
    
I agree with you 100% re the language. You shouldn't need auto-complete for that; if you do, you should be reading the docs while you're still in the learning phase. But I actually think that you also shouldn't need auto-complete for the libraries or frameworks, either. If they are really that bad, don't code directly to them. Instead wrap them with your own interface that is easy to remember and fits your app's needs. That will pay off in many ways beyond just ease of remembering and typing. –  Greg Hendershott Oct 15 '11 at 23:24
    
@GregH, perhaps it depends on the particular framework. Apple's various Objective-C frameworks are pretty verbose. That actually makes the methods easier to remember, but it can still be a lot of typing and it's still easy to get a name wrong by just a bit. Example: addPersistentStoreWithType:configuration:URL:options:error:. It's worse in C or C++, where names are shorter but you have to remember how many parameters there are and which order they go in. There's no reason to memorize entire frameworks when you can easily look up it up, and no need to look it up if the IDE will do it for you. –  Caleb Oct 16 '11 at 1:41
add comment

I see it frowned upon a lot by folks who code in dynamic languages or languages without a sophisticated IDE available. Java or .NET programmers love it. Even for APIs that I'm familiar with, it saves a ton of time so I don't have to remember spelling or argument lists for thousands of methods or keep the javadocs open all day. I've been doing some Python with Eclipse + PyDev recently and it's helpful, but limited. Dynamic languages in general aren't well-suited to autocomplete since methods may not be known at compile time and argument lists may be variable.

share|improve this answer
add comment

Autocomplete is good - if you know what you're doing.

Points in favor:

  1. No need to memorize the whole of various libraries.
  2. Easy to see what's available (I use this in Python a lot after importing something, to remind myself what's in the module, if I'm looking for something and uncertain how to use it)

Points against:

  1. You have no need to memorize anything, so you're less likely to try and keep it in your mind.
  2. In some cases, autocomplete can slow you down. Offhand, Eclipse and Java pops into mind - if I know what I'm doing, the autocomplete popups distract me and break the flow.

Neutral points to keep in mind:

  1. If you use a library function often enough, you'll have it memorized just because you see it so often. This can help you memorize the correct spelling because it's pulled up automatically - or it can hinder memorization because you're relying on autocomplete to get it right.
  2. If you don't use it often enough to memorize on its own, there's probably a reason. In that case, best to look at the documentation to make sure you understand the function, and aren't just tossing it in because autocomplete found it.
share|improve this answer
add comment

One method of learning a new language or algorithm is to re-type the example(s) totally from scratch. I find that re-typing an algorithm (even if the example is is cut-n-pasteable) focuses my attention and causes me to question every operator, every function call. Auto-complete in this circumstance would detract from my learning.

To address your question direction: It depends on the circumstance. If you're learning, or you just want to avoid Cargo Cult Programming, then avoid auto-complete.

share|improve this answer
add comment

These days I would phrase the question the other way around ´Is it wrong to code without autocomplete?´. If you are using descriptive naming you are very likely to misspell at least some references. A good IDE will suggest a reasonable set of suggestions at any point.

The things we are coding have become extremely complex, and it would be unreasonable to expect programmers to know all of the components they need to reference off the top of their head, and to spell all the references without mistakes. Autocomplete simplifies the task significantly and allows the programmers to concentrate on the complexities of the code.

share|improve this answer
add comment

Computers are good at exact string matching (especially in the case of hash-tables) - humans are not. Brains are associative constructions that recall code often using in-combinations of its sub-words and their synonyms and not neccessarily in the correct order. That's why IDEs exist and why there is still room for improvements in this area.

LLVM are taking innovative steps (thanks to Apple's money) in this direction through its IDE-plugin library libclang. libclang supports fuzzy spelling corrections of indentifiers based on the Levenhstein (Edit) Distance.

share|improve this answer
    
Spelling corrections on indentifiers? :) –  Michael Kjörling Oct 17 '11 at 11:28
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.