I’ve been thinking about this for a little while now, before I put in a feature request I thought I’d seek some enlightenment. I’m trying to figure out why the decision has been made to limit autocomplete in the way it does. Is it a feature or a limitation of how things are implemented in the IDE?
Bear with me here as I write out my thought process, let me know if you agree/disagree?
Let say you want to read from a socket. So you:
Dim oSocket As New TCPSocket
I’m guessing that Read will be in there somewhere so:
oS<TAB>.rea<TAB>
Nothing, hmm, maybe its called somethings else.
Right click TCPSocket and Open Language Reference.
Methods > Read, hmm its there.
Oh right, it returns a string.
Dim tmp As String
tmp = oS<TAB>.rea<TAB>
Can you see where I’m going with this?
What is the use of an autocomplete system that puts the onus on the coder to remember that a call must have a return value before even showing it on the autocomplete list? Why not show everything that is available for oS and let the coder worry about taking care of the return value after the fact? If they don’t it will be caught in compilation with the “You must use the value returned by this function” error message.
The ironic part is that it doesn’t even matter if I changed tmp to an Integer in the example above, it would still let the autocomplete work so why stop it in the first place if I’m going to end up with a compilation error anyway?
The time that this gets really painful is when you can’t look things up with the Language Reference, like with custom Methods etc. I can quite often remember the first few characters of the call enough to narrow the autocomplete list, but when it doesn’t show because it has a return value I start to question if I have the right method call, when that happens I have to go digging and get a tiny bit frustrated when I was right on the money with my guess, I just forgot to put “a=” in front of the guess, even though I don’t need to declare a! It just seems like being pedantic for the sake of being non-intuitive and awkward, or is it just me?
Thoughts/comments?