Intellisense

djberg96 on 2004-09-01T15:03:16

From Darren Oakey's blog:

Anyway - I pointed out that the single most important productivity tool in modern languages is intellisense... without it, he can't hope to pull [Smalltalk] into the '90s.
I can count the number of times I've found intellisense useful on one hand. You see Darren, real programmers read and learn the API. Those few times we can't remember a particular method we just look it up. Of course, most languages don't have the bloated monstrosity of an API that Java has. But, as Dave says:
When your language is so verbose that it needs machine assistance to be usable, you've got a crappy language.
Amen.


Perl's intellisense

ziggy on 2004-09-01T15:16:17

Perl actually does have intellisense. It's just not supported by a big bloated IDE with dropdown boxes that helpfully guess what you could possibly mean as you type. Instead, Perl uses huffman coded operators like grep, map, split, $scalar = @array , interpolation and so on.

> When your language is so verbose that it needs machine
> assistance to be usable, you've got a crappy language.


Yep. A good language has intellisense for both reading and writing code. Giving you a crutch to write voluminuous amounts of code faster is not only solving the wrong half of the problem, but it is solving the wrong half of the problem in the wrong way.

Re:Perl's intellisense

lachoy on 2004-09-01T15:50:14

Perl actually does have intellisense. It's just not supported by a big bloated IDE with dropdown boxes that helpfully guess what you could possibly mean as you type. Instead, Perl uses huffman coded operators like grep, map, split, $scalar = @array , interpolation and so on.

This is a little disingenuous, isn't it? The examples you're quoting are all built-ins, and I doubt that most people use intellisense for such items. IME it's really useful for keeping on top of libraries, particularly those you don't use very frequently. Even so, isn't one of the great features of Perl people often tout the ubiquitousness of 'perldoc -f' for built-ins and 'perldoc Module' for libraries? Wouldn't it be great to have to remember if, for instance, the constructor for a DateTime object took a hash vs a hashref? Or, since good intellisense implementations in Java also include inline javadocs, whether DBI's bind_param is 0- or 1-based?

If I used these items every other day, sure I'd remember them without any help. But I use a LOT of libraries -- benefits of CPAN and working with any language with an an active open source community -- and I don't think I'm unusual in not being able to call up the details of every API on demand.

Actually, one of the main benefits I see for something like Perl 6 is to be able to create an IDE as good as IntelliJ IDEA for Perl. I didn't like IDEs before this one, even for Java, but it's a great tool that helps you code rather than codes for you.

Re:Perl's intellisense

ziggy on 2004-09-02T02:07:41

This is a little disingenuous, isn't it?
Not really.
The examples you're quoting are all built-ins, and I doubt that most people use intellisense for such items.
That's precisely my point. One of the reasons why Intellisense is almost a requirement for programming in C/C++/C# and Java is because of the type system, and the over complexity of the programming model. With Java, you have big class hierarchies, interfaces, and dozens of classes with dozens of methods. For example, if I want to iterate over a list, I need to construct an iterator and use methods like next and hasNext on that iterator. It's a lot of typing. In the degenerate case, I could be using a class that has a lot of methods named get_foo, get_bar and so on. And don't get me started on the syntactic complexity in creating a closure (er, an anonymous inner class).

In Perl, there's a whole mess of stuff you can accomplish with the three basic datatypes. Most of those operations are monosyllabic builtin functions. A whole mess of operations like m// can be coerced to use $_, which eliminates the need to say what can be automatically inferred. Some of the common cases even use syntactic sugar to do what you mean (c.f. while (<>) {...}).

In terms of objects, the general idiom is to bless hash references into objects. If you want to mess with instance data, you can peek and poke directly into the guts of an object: print $obj->{count}; $obj->{count}++. We can debate the merits of that design philosophy separately, but it certainly obviates the need to create ~two methods for each instance variable (and consequently reduces method signatures).

IME it's really useful for keeping on top of libraries, particularly those you don't use very frequently.
I didn't think of libraries, but you bring up a good point. I've avoided really nasty class hierarchies like those that are found with Java or any decent C++ framework. I find that in Perl, I don't need the wall charts of the inheritance tree, or a playbook of what's what before I can use a set of libraries. Core / CPAN modules tend to be easier to grasp and keep in my head. (This isn't an natural property of Perl per se, just a set of design principles many Perl module authors share.)
Wouldn't it be great to have to remember if, for instance, the constructor for a DateTime object took a hash vs a hashref? Or, since good intellisense implementations in Java also include inline javadocs, whether DBI's bind_param is 0- or 1-based?
In theory, it would. In practice, it'd be easier if Perl defined a convention (all array counts start at zero) and modules adhere to that convention.

In theory, it would be nice to add all of these wizzy new features into a drop dead stunning Perl IDE. In practice, a simple text editor with a handful of powerful abstractions and common design principles is at least as good, if not better.

Re: Intellisense

jplindstrom on 2004-09-01T21:49:55

I started writing a reply, but it got upgraded to it's own journal entry :)

Re: Intellisense

djberg96 on 2004-09-01T23:48:53

Heh - I read it. I think perhaps you misunderstood my point. I have no problem with Intellisense. If you like it, great. It's probably very handy for some people.

What I'm really mocking is Darren's assertion that Intellisense is "the single most important productivity tool in modern languages". I mean, please people. That, coupled with the notion that Smalltalk failed because it didn't have a cool enough IDE.