Intellisense and the psychology of typing

Yesterday I typed in some C++ code that called a function with two
ints. Intellisense (auto-complete) helpfully told me that the first
formal parameter was called "frontLight" and the second "ringLight". It
occurred to me that I'm getting some semantic help here on top of the
obvious type safety. It seems to me that the existance of this kind of
support is tied to the static typing nature of C++.

I've always been interested in the psychology behind those heated
"static" vs. "dynamic" (quotes to avoid another lengthy discussion
about manifest, latent, explicit, ...) typing debates. So I googled
"Intellisense static dynamic typing" and tried to get a view of the
collective mental landscape of this subject. It appears that the
threads that talk about Intellisense soon run dry. I'm wondering if
this is because:

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

Any opinions?

Thanks,
Andrew

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

I'm indifferent. It depends what mood I'm in as to whether it is useful
or not -- and invariably I tend not to use it, if only because, being
the author, I know what formal parameters most methods expect.

2) Intellisense is really useful but hard to implement well in
IDEs for dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

It isn't easy -- just look at what CEDET[1] do, and you'll soon see the
headache involved in using it with EMACS. There's strong talk of
intellisense being introduced into Vim7, and it does already exist in a
limitied capacity with "cream"[2], but only for a particular filetype,
that I can determine.

Of course, in the case of ruby, where ambiguity tends not to matter, how
would you distinguish between:

puts "hello there, how are you", "I'm fine"

and:

puts ("hello there, how are you", "I'm fine")

... it is not as easy as you'd think.

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

Depends on the programmer.

-- Thomas Adam

[1] http://cedet.sourceforge.net/
[2] http://cream.sf.net

···

On Fri, May 27, 2005 at 01:35:19AM +0900, andrew.queisser@hp.com wrote:
--
"One of us is a cigar stand, and one of us is a lovely blue incandescent
guillotine" -- Stephen Malkmus, "Type Slowly" from "Brighten The Corners"

my opinion is that if you find it useful, use it. if you don't then
don't... either way, its up to you to decide what's useful and what's
not. don't ask us. Try it out yourself.

I'm all for intelligent help. But I just wanted to point out that this particular example has nothing to do with static typing. "frontLight" and "ringLight" were parameter names. Any language that has named parameters could do this regardless of whether or not those parameters were typed.

Curt

···

andrew.queisser@hp.com wrote:

Yesterday I typed in some C++ code that called a function with two
ints. Intellisense (auto-complete) helpfully told me that the first
formal parameter was called "frontLight" and the second "ringLight". It
occurred to me that I'm getting some semantic help here on top of the
obvious type safety. It seems to me that the existance of this kind of
support is tied to the static typing nature of C++.

Hello andrew,

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

When doing wrong (showing wrong types, obmitting methods, adding wrong
methods) it might harm more then being good.

Intellisense has 2 completely different use cases:

a) Reducing typing overhead.
   This is easy to implement

b) Learning the API.
   This is the real hard one.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

for use case (a) it is implemented in a few IDE's/Editors
for (b) nobody came up to a useable implementation upto now. I don't
think that the JEdit latest plugin is so useful for people who want to
do (a) or (b).

Intellisense is usefull without doubt. But it is to 90% a feature of
static typed languages.

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

No you must check your understanding of program runtime and editing time.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

Andrew, code auto-completion is not tied to static typing. Your search
for 'IntelliSense' (a Microsoft trademarked term) might not find all
relevant discussions, try auto completion, code completion or method
completion.

My efforts to implement code completion in the Ruby Editor Plugin for
jEdit have been successful to date. Currently the plugin supports
type-based method completion for the Ruby core types, using a naive
variable type detection algorithm. Implementation work hasn't been too
hard, just time consuming.

The plugin's documentation viewer window displays documentation for
your current selection on the method completion popup. My personal use
of the plugin's method completion has mainly proved useful in helping
me learn Ruby APIs.

Future improvements to the plugin will allow the user to select RDoc
they want to import. The imported RDoc will be displayed in the
documentation viewer, and also be used to show additional methods in
the completion popup. So for example you'd be able to import the Rails
RDoc and then autocomplete Rails methods.

Ruby Editor Plugin for jEdit - jEdit's Ruby Editor Plugin

Rob

andrew.queisser wrote:

···

Yesterday I typed in some C++ code that called a function with two
ints. Intellisense (auto-complete) helpfully told me that the first
formal parameter was called "frontLight" and the second "ringLight". It
occurred to me that I'm getting some semantic help here on top of the
obvious type safety. It seems to me that the existance of this kind of
support is tied to the static typing nature of C++.

I've always been interested in the psychology behind those heated
"static" vs. "dynamic" (quotes to avoid another lengthy discussion
about manifest, latent, explicit, ...) typing debates. So I googled
"Intellisense static dynamic typing" and tried to get a view of the
collective mental landscape of this subject. It appears that the
threads that talk about Intellisense soon run dry. I'm wondering if
this is because:

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

Any opinions?

Thanks,
Andrew

1) Intellisense is really just another crutch that does more harm than
good?

To me I found the intellisense in VS for C++ was somewhat helpful in my
earliest stage of learning where I had to look up how many args a function
had. After a while, I found it more convenient to just keep the VS
language and std lib docs open in another window. IOW, it started getting
in the way. Maybe at times it can save some keystrokes but I kept finding
a pattern of start typing something...down arrow...down arrow...down
arrow...down arrow...tab...type args. Even worse is the situation were
start typing something...downWhoops hit left arrow...hit end...hit
backspace...type last letter....down arrow...etc...tab...etc...

How egregious!? No thank you; I already use variable names like "myData"
instead of "mD" so extra keystrokes are not that big of a deal :slight_smile:

Still I think calling it a crutch might be a bit extreme. Is a book or
documentation a crutch too?

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages?

Maybe for some people and yes. There was some recent discussion in this
very NG about this WRT vim et al.

Cheers,

~Jason

···

On 5/26/2005 12:31, andrew.queisser@hp.com wrote:

--

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
                http://www.usenet.com

Intellisense does improve programmer productivity as
you do not have to keep opening header files to refer
to the interfaces. In VC++ the intellisense display
also shows the function header comment, so you have
full access to the information about the interface.

Deepa

···

--
EventStudio 2.5 - http://www.EventHelix.com/EventStudio
Model in Plain Text; Generate Sequence Diagrams in PDF/Word

Well, there are two distinct features of IntelliSense as you know it.
One is auto-completion and the other is contextual help.

Auto-completion is included almost all beefy Python IDE's.

Contextual help is included even in IDLE, where if you begin typing a
function call, its docstring pops up around where you are typing.
Since many functions have dynamic arguments, I think this really is the
best solution, since the implementor of the function knows what would
be the most helpful to show. Open the interactive IDLE prompt and type
max(, iter(, help(, for example -- although most of those are pretty
minimal.

<andrew.queisser@hp.com> wrote>

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

I'm primarily a VB programmer, but I also do Java and web stuff as well.
Whenever I look at a new IDE the FIRST thing I look at is whether
Intellisense-like functionality is present. If it is not, I discard it from
further consideration. The reason has nothing to do with static vs dynamic
typing. It has to do with the fact that I spend a considerably amount of
time thinking about how I'm going to solve the problem at hand. Filling my
head with API specs that I have to look up is just a pain. And frankly if I
have to type 'boolean' instead of 'boo<tab>' I get real cranky real fast.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

It might be and probably is. But I say if dynamic typers want the
flexibility they think they are getting then they should have to deal with
ALL of the consequences.

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

I can't speak to that only to say that, how in the world can an object that
accepts anything reasonable be expected to protect itself from misuse or
provide reliable services given a set of parameters?

I have rapidly skimmed over the few responses here. Auto completion is
definitly possible in dynamic languages: Common Lisp has it with its
Emacs mode, SLIME.

If you're in a slime buffer, you type (get-un then press C-c Tab and
Emacs will auto-complete with (get-universal-time), if there are many
choices, they will be displayed in a split window, if the function
takes parameters, those will appear in the mini-buffer, like so:

(with-open-file (stream sb-impl::filespec &rest sb-impl::options) &body
body)

SLIME is also not the only place where a dynamic language has
auto-completion, check out Ecomplete in Squeak or the auto-complete
package in Visual Works Smalltalk. It can be done, maybe not as easily
as in a statically typed language, but it definitly can be done.

Hello Vincent,

I have rapidly skimmed over the few responses here. Auto completion is
definitly possible in dynamic languages: Common Lisp has it with its
Emacs mode, SLIME.

If you're in a slime buffer, you type (get-un then press C-c Tab and
Emacs will auto-complete with (get-universal-time), if there are many
choices, they will be displayed in a split window, if the function
takes parameters, those will appear in the mini-buffer, like so:

When using procedural code it is easy and not comparable with autocompletition for Ruby.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

Static typing is a strong enabler of certain intelisense functions;
but not all, nor even most. A good IDE for a dynamically typed
language can make quite a few inferences to decide how to suggest
intellisense. That said, statically typed languages will always have
better intellisense than dynamically typed languages.

Indeed, one of the reasons that I have not switched to Ruby as my
standard language is the wonderful tools available with "IntelliJ" for
Java and "ReSharper" for C#.

···

On 26 May 2005 09:31:12 -0700, andrew.queisser@hp.com wrote:

Yesterday I typed in some C++ code that called a function with two
ints. Intellisense (auto-complete) helpfully told me that the first
formal parameter was called "frontLight" and the second "ringLight". It
occurred to me that I'm getting some semantic help here on top of the
obvious type safety. It seems to me that the existance of this kind of
support is tied to the static typing nature of C++.

I've always been interested in the psychology behind those heated
"static" vs. "dynamic" (quotes to avoid another lengthy discussion
about manifest, latent, explicit, ...) typing debates. So I googled
"Intellisense static dynamic typing" and tried to get a view of the
collective mental landscape of this subject. It appears that the
threads that talk about Intellisense soon run dry. I'm wondering if
this is because:

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

Any opinions?

-----
Robert C. Martin (Uncle Bob) | email: unclebob@objectmentor.com
Object Mentor Inc. | blog: www.butunclebob.com
The Agile Transition Experts | web: www.objectmentor.com
800-338-6716

"The aim of science is not to open the door to infinite wisdom,
but to set a limit to infinite error."
    -- Bertolt Brecht, Life of Galileo

Hello Thomas,

1) Intellisense is really just another crutch that does more harm than
good? There were a few hardcore defenders of this position but not
many.

I'm indifferent. It depends what mood I'm in as to whether it is useful
or not -- and invariably I tend not to use it, if only because, being
the author, I know what formal parameters most methods expect.

Intellisense is most useful for the case where you use libraries or
modify/extend code that you don't have written (aka multi person
projects).

Sometimes i think that the missing typeing eats up very much of the
time that is saved by being typeless as Code is much harder to read
and understand. That's why i simply can't understand people who are
against "optional" type declarations.

···

On Fri, May 27, 2005 at 01:35:19AM +0900, andrew.queisser@hp.com wrote:

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

Curt Hibbs wrote:

···

andrew.queisser@hp.com wrote:
> Yesterday I typed in some C++ code that called a function with two
> ints. Intellisense (auto-complete) helpfully told me that the first
> formal parameter was called "frontLight" and the second "ringLight". It
> occurred to me that I'm getting some semantic help here on top of the
> obvious type safety. It seems to me that the existance of this kind of
> support is tied to the static typing nature of C++.

I'm all for intelligent help. But I just wanted to point out that this
particular example has nothing to do with static typing. "frontLight"
and "ringLight" were parameter names. Any language that has named
parameters could do this regardless of whether or not those parameters
were typed.

Curt

But only if the receiver and the types of the arguments of the function
call can be resolved. In my case it was the class LightController but
in a dynamic language the call might be ambiguous.

Andrew

Hello James,

I'm primarily a VB programmer, but I also do Java and web stuff as well.
Whenever I look at a new IDE the FIRST thing I look at is whether
Intellisense-like functionality is present. If it is not, I discard it from
further consideration. The reason has nothing to do with static vs dynamic
typing. It has to do with the fact that I spend a considerably amount of
time thinking about how I'm going to solve the problem at hand. Filling my
head with API specs that I have to look up is just a pain. And frankly if I
have to type 'boolean' instead of 'boo<tab>' I get real cranky real fast.

Yes you come from static typed languages, so you have to learn
things are different in dynamically typed languages.

2) Intellisense is really useful but hard to implement well in IDEs for
dynamic languages? Can anyone comment on the status of
Intellisense-like tools for dynamic-language IDEs?

It might be and probably is. But I say if dynamic typers want the
flexibility they think they are getting then they should have to deal with
ALL of the consequences.

The most normal consequence is that there is no intellisense. Thats
how we deal with it at the moment - and yes i agree with you that this
is not a positive consequence.

3) Users of dynamic languages are always developing/debugging running
programs where the current type of a variable is known and hence
Intellisense is possible again? My own limited experience with dynamic
languages (Ruby) is limited to edit-run cycles.

I can't speak to that only to say that, how in the world can an object that
accepts anything reasonable be expected to protect itself from misuse or
provide reliable services given a set of parameters?

Many people will argument that typing errors are far less common then
one would expect at the first time when comming from a static typed
language. I don't know about large systems in Ruby but there are a few
really large SmallTalk programs out there and they work fine.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

"James D Carroll" <jamesdcarroll@hotmail.com> wrote in message
news:Td2dndb_0ehebwrfRVn-oA@speakeasy.net...

if I have to type 'boolean' instead of 'boo<tab>' I get real cranky real

fast.

Why? Is your programming speed really limited by the difference
between typing "lean" and hitting <tab>? If typing speed is
the limitation - go get some touch-typing courses.

Touch-typing is good (and I should also learn that :slight_smile: but it's always
easier to mistype "lean" than a tab :slight_smile:

Michal Suchanek

···

On Sun, May 29, 2005 at 12:30:20PM +0900, Lurker wrote:

"James D Carroll" <jamesdcarroll@hotmail.com> wrote in message
news:Td2dndb_0ehebwrfRVn-oA@speakeasy.net...

> if I have to type 'boolean' instead of 'boo<tab>' I get real cranky real
fast.

Why? Is your programming speed really limited by the difference
between typing "lean" and hitting <tab>? If typing speed is
the limitation - go get some touch-typing courses.

Hello Vincent,

I have rapidly skimmed over the few responses here. Auto completion is
definitly possible in dynamic languages: Common Lisp has it with its
Emacs mode, SLIME.

If you're in a slime buffer, you type (get-un then press C-c Tab and
Emacs will auto-complete with (get-universal-time), if there are many
choices, they will be displayed in a split window, if the function
takes parameters, those will appear in the mini-buffer, like so:

When using procedural code it is easy and not comparable with autocompletition for Ruby.

Er, Lisp is a procedural language?

···

Le 29/5/2005, "Lothar Scholz" <mailinglists@scriptolutions.com> a écrit:

Lothar Scholz

--
template<typename duck>
void quack(duck& d) { d.quack(); }

You don't need to write 'b

···

On 5/28/05, James D Carroll <jamesdcarroll@hotmail.com> wrote:

And frankly if I
have to type 'boolean' instead of 'boo<tab>' I get real cranky real fast.