Code Completion by IDEs - How Complete?

CCH wrote:

Do you need to activate the trial on CodeGear’s website?

Hi

The result is out for code completion of a simple typing of
validates+ctrl_space

1.1 NBRubyIDE
Result :
validates_presence_of *attr_names

1.2 Aptana RadRails
Result :
validates_presence_of(attributes, :message => “message”)

1.3 Ruby in Steel
Result :
validates_presence_of

1.4 3rdRail
Result :
validates_presence_of

CONCLUSION :
So seemingly, Aptana RadRails has the most useful code completion for
this simple test.

To be fair, I have seen a Video cast of Shelby of CodeGear showing
impressive code completion on a migration file.
In addition, Tor of netbeans had already promised to look into
improving the completion code for my random example.

CCH, on the download page it has instructions for requesting a key,
you do need to register it.

On Sep 28, 1:28 am, Anthony R. [email protected]
wrote:

CONCLUSION :
So seemingly, Aptana RadRails has the most useful code completion for
this simple test.

To be fair, I have seen a Video cast of Shelby of CodeGear showing
impressive code completion on a migration file.
In addition, Tor of netbeans had already promised to look into
improving the completion code for my random example.

CCH,

Like I’ve said, code completion is much more complex than this, you
can’t select one scenario to judge all IDEs. Each has it’s strengths
and weaknesses. I can pick out an example that makes NetBeans look
great or one that makes 3rdRail The Ruler.

This is why I haven’t been pasting specific examples here. No one
wants this to become a relegious war, arguing one discrete example
against the other.

Two things that would be more productive IMO:

  1. If you find shortcomings in a tool report them to the folks that
    make the tool so they can make it better.

  2. If you really want to compare code completion, put together a
    comprehensive matrix of places where completion should exist (types of
    files, types of code fragments, different kind of syntax errors the
    completion should recover from) and what choices should be provided
    and do a complete comparison. This would show intersections for
    different situations (methods defined on a parent class, methods
    defined in the current class, dynamic methods provided by the
    framework, dynamic methods provided by user code, for a simple
    example) and what would be provided there (paramater arity, paramater
    types, locally-defined paramater choices, paramater choices that are
    made available by the framework, method calls that return the type
    represented by the paramater…etc)

Then users can look at this and decide which tool best meets their
needs.

Just my two cents.

There seems to be a confusion with what we all mean by ‘code
completion’. Joe, Tor and I are talking about what is called (in the
Microsoft world), ‘IntelliSense’ - that is, code compeltion lists which
provide ‘suggestions’ of code (such as methods) which are appropriate in
a given context/scope. This is what we mean when discussing code
completion in 3rd Rail, NetBeans and Ruby in Steel.

The example that’s been quoted in favour of RADRails (that is, insertion
of validates_presence_of with extra args shown) is more like what we
would call ‘snippets’ in Ruby In Steel and which other IDEs may call
templates (though similar functionality might also be programmed as a
macro). We can certainly do auto-expand snippets (and macros) with,
optionally, editable ‘fill in the gap’ placeholders for you to edit the
argument lists. But that is a different feature from what Joe, Tor and I
mean when we talk about code completion.

best wishes
Huw

SapphireSteel Software
Ruby and Rails In Visual Studio
http://www.sapphiresteel.com

Hi Joe /Huw

Of course, both of you are right.

What I was trying to point out was that sweeping statements made by
overzealous fans/developers etc of IDEs can easily be debunked !
IMHO, one should by all means trumpet the great features (eg, Project
Commander in 3rd Rail) but not at the expense of condemning another
with four-letter words.

I believe, I have already made my point :slight_smile:

The bottom line is that there must be healthy competition and IDE
developers who do not wish to accept constructive criticism and
improve will simply perish…

TQ

CCH wrote:

1.4 3rdRail
Result :
validates_presence_of

CONCLUSION :
So seemingly, Aptana RadRails has the most useful code completion for
this simple test.

CCH,

What O/S are you running? On Windows XP, the following happens (I just
tested this):

validates_presence_of
… :description
… :email
… :other_attributes
… find_all_by_description(description, *options) - ::User
… find_all_by_email(description, *options) - ::User
… find_all_by_other_attr(description, *options) - ::User

Hi Cody

CCH,

What O/S are you running? On Windows XP, the following happens (I just
tested this):

cchL Windows XP Pro, SP2

validates_presence_of
… :description
… :email
… :other_attributes
… find_all_by_description(description, *options) - ::User
… find_all_by_email(description, *options) - ::User
… find_all_by_other_attr(description, *options) - ::User

cch: When I type validates+ctrl+spacebar in 3rdRail
a dropdown list is shown and when I select validates_presence_of ,
validates_presence_of is inserted

Radrails inserts

validates_presence_of(attributes, :message => “message”)

which is clearly more appropriate :slight_smile:

Hi Code

Aptana Radrails have similar functionality, check it out…

On Sep 29, 3:30 am, Cody S. [email protected]

Cody S. wrote:

validates_presence_of
… :description
… :email
… :other_attributes
… find_all_by_description(description, *options) - ::User
… find_all_by_email(description, *options) - ::User
… find_all_by_other_attr(description, *options) - ::User

When editing a stylsheet in 3rdRail, the following occurs:

a {

a whole list of sytle attributes
}

select background-image

a {
background-image
*url("")
*none
*inherit
}

Having a unified editor where you don’t have to switch from one tool to
another when editing code, style sheets, and templates is pretty cool.

Hi Chris

On Sep 29, 4:32 pm, Chris B. [email protected]
wrote:

RadRails is a nice balance of a compact work space, console/logger, and
syntax hilighter. I also like its Auto-completion functionality, but
it’s anywhere from complete OR consistent. And it’s preferences panel
leaves much to be desired. Then again, it is still a beta release so you
have to take some of those problems in context. I look forward to future
releases.

cch: Pretty appropriate description of Aptana Radrails which has
worked for me thus far.
FYI, they have in mind a Project Commander functionality in future…

On Sat, 29 Sep 2007 10:32:39 +0200, Chris B. wrote:

“e” was clunky IMO, and it was too dependent on Cygwin for my tastes (I
like cygwin, but getting Ruby and Rails installed on it took some extra
steps compared to Windows). I tried it for less than a day before coming
across RadRails, so I can’t say too much more about it. However, since
it uses the same auto-completion files as TextMate, it most likely has
RadRails licked in that department.

“e” is a nice idea, but unfortunately it’s open-source-alpha quality
with
closed-source-1.0 development; you have to pay, there’s only one guy
writing it, and it’s really really slow and buggy right now. Many basic
things don’t work, like HOME and END keys. It also takes about 5
seconds
just to launch on my dual-3GHz PC.

There’s also a newcomer Windows TextMate clone, InType, but it’s in
fairly
early days as well, and considering he’s not going the cygwin route, I
imagine most TextMate bundles will need heavy hacking to work in InType.


Jay L. |
Boston, MA | My character doesn’t like it when they
Faster: jay at jay dot fm | cry or shout or hit.
http://www.jay.fm | - Kristoffer

On Sep 28, 11:58 pm, CCH [email protected] wrote:

cch: When I type validates+ctrl+spacebar in 3rdRail
a dropdown list is shown and when I select validates_presence_of ,
validates_presence_of is inserted

Radrails inserts

validates_presence_of(attributes, :message => “message”)

which is clearly more appropriate :slight_smile:

As Huw explained yesterday, you’re talking about a different feature -
code template insertion (aka “snippets” in textmate). In Aptana, try
typing “validates”+ctrl+space in ANY file (not just a model file) and
it will offer the exact same thing. I think all the other IDEs being
discussed here offer the same feature. Code snippets weren’t showing
up in code completion in NB6 beta1 but it’s there in the dailys - see
this screenshot:
http://blogs.sun.com/tor/resource/codetemplate-completion.png

I’m not trying to put down Aptana in any way, but since you started
this thread comparing “code completion” among the IDEs and since you
have several times now implied that Aptana has the best code
completion, I felt it important to point out that your comparison is
unfair.

Hi Thor

Of course, all 3 you are right.

Like I said earlier, what I was trying to point out was that sweeping
statements made by
overzealous fans/developers etc of IDEs can easily be debunked !
IMHO, one should by all means trumpet the great features (eg, Project
Commander in 3rd Rail) but not at the expense of condemning another
with four-letter words.

I believe, I have already made my point :slight_smile:

The bottom line is that there must be healthy competition and IDE
developers who do not wish to accept constructive criticism and
improve will simply perish…

Code snippets weren’t showing
up in code completion in NB6 beta1 but it’s there in the dailys - see
this screenshot:http://blogs.sun.com/tor/resource/codetemplate-completion.png

cch:
BTW, I have just downloaded the latest hudson 4289 and

validates+ctrl+space still inserts

validates_presence_of *attr_names

Over to you…

BTW, at first glance , l think your css editor is the best.

Do you have a google group or similar to post bugs comments already
discovered ?

On Sep 29, 9:09 am, CCH [email protected] wrote:

cch:
BTW, I have just downloaded the latest hudson 4289 and

validates+ctrl+space still inserts

validates_presence_of *attr_names

Over to you…

Ctrl+space shouldn’t insert anything. It should just pop up a list of
alternatives. It’s up to you which item in the list you choose.

If you choose the above method, then yes, it will insert the above
signature (which matches the definition in the Rails code for the
validates_presence_of method, but yes, it should be smarter here and
offer better parameter items, which soon it will :wink:

If you on the other hand choose some of the code templates listed
below (different icon, see the earlier screenshot I listed) then it
will insert the corresponding code template.

A faster way than typing out the prefix and hitting ctrl-space is to
just type the trigger name (listed on the right in the completion
popup). E.g. for validates presence of, type just “vp”+tab, or
“vpif”+tab. Yes, these are the TextMate snippet names.
Unfortunately, 15 of the snippets were truncated at import (tracked by
NetBeans issue 117104), and “vp” is one of them - which is why it
doesn’t insert a hash value yet. More details about the code snippets
are listed here: http://wiki.netbeans.org/wiki/view/RubyCodeTemplates
.

Do you have a google group or similar to post bugs comments already
discovered ?

The various feedback channels (issue tracker, mailing lists, forums,
etc) are listed here:
http://wiki.netbeans.org/wiki/view/RubyFeedback

In particular, a forum interface to our “dev” and “users” mailing
lists is available here:
http://www.nabble.com/NetBeans-Ruby-f27019.html

– Tor

CCH wrote:

Hi Code

Aptana Radrails have similar functionality, check it out…

On Sep 29, 3:30 am, Cody S. [email protected]

I’m using RadRails since I can’t spring $2049 for TextMate (and
accompanying Mac). I’ve also tested the “e” editor, and otherwise have
used EditPlus.

EditPlus doesn’t do code completion, but I find that it has better
per-language (really per-file-extension) configuration options. Much
like radRails, it has some capacity to capture console output from an
external program, or just trigger another program altogether. In
general, this is my editor of choice. FWIW, I just submitted an RHTML
syntax file that you can download from the User Files section of
editplus.com.

RadRails is a nice balance of a compact work space, console/logger, and
syntax hilighter. I also like its Auto-completion functionality, but
it’s anywhere from complete OR consistent. And it’s preferences panel
leaves much to be desired. Then again, it is still a beta release so you
have to take some of those problems in context. I look forward to future
releases.

“e” was clunky IMO, and it was too dependent on Cygwin for my tastes (I
like cygwin, but getting Ruby and Rails installed on it took some extra
steps compared to Windows). I tried it for less than a day before coming
across RadRails, so I can’t say too much more about it. However, since
it uses the same auto-completion files as TextMate, it most likely has
RadRails licked in that department.

I can’t speak to any of the others that you tested.

Hi Tor

On Sep 30, 12:54 am, Tor N. [email protected] wrote:

Ctrl+space shouldn’t insert anything. It should just pop up a list of
alternatives. It’s up to you which item in the list you choose.

cch: Sorry, I mean Ctrl+space and then slect :slight_smile:

If you choose the above method, then yes, it will insert the above
signature (which matches the definition in the Rails code for the
validates_presence_of method, but yes, it should be smarter here and
offer better parameter items, which soon it will :wink:

cch: This feature is very useful to newcomers to RoR

If you on the other hand choose some of the code templates listed
below (different icon, see the earlier screenshot I listed) then it
will insert the corresponding code template.

cch: Noted

A faster way than typing out the prefix and hitting ctrl-space is to
just type the trigger name (listed on the right in the completion
popup). E.g. for validates presence of, type just “vp”+tab, or
“vpif”+tab. Yes, these are the TextMate snippet names.

cch: Cool Tip !
I’ll definitely check this out, Nbrubyide/hudson is getting better and
better.

etc) are listed here:http://wiki.netbeans.org/wiki/view/RubyFeedback

In particular, a forum interface to our “dev” and “users” mailing
lists is available here:http://www.nabble.com/NetBeans-Ruby-f27019.html

cch: TQ
BTW, there is a bug in your gem manager when there is a need to choose
1/2/3/4
I was trying to install fast debugger and chooing 2 just hangs

The SVN integration is really cool but I noticed that one can check
out a project say crm4web into different folders and both folders will
appear in the Project View as crm4web which is pretty confusing …

On Sep 29, 9:54 am, Tor N. [email protected] wrote:

“yes, it should be smarter here and offer better parameter items, which soon it will”

Just an update on this older thread, since I promised it would work
better soon:
http://blogs.sun.com/tor/entry/ruby_screenshot_of_the_week20

– Tor