Good editor for Linux?

J

Johs

I use Ubuntu 7.04 and have trouble finding a good editor that has
autocompletion (when typing std:: or using "." on strings or pressing
ctrl+space).

I have tried eclipse with CDT 3.1.2 but it takes about a minute before
the popup box appears. I have also tried KDevelop and anjuta but they
only autocomplete previous declared variables. I would like to avoid
using emacs because of the wierd keymap.

Are there any alternatives left or are there no tradition for using
autocompletion when writing c++?
 
P

Phlip

Johs said:
I use Ubuntu 7.04 and have trouble finding a good editor that has
autocompletion (when typing std:: or using "." on strings or pressing
ctrl+space).

I have tried eclipse with CDT 3.1.2 but it takes about a minute before the
popup box appears. I have also tried KDevelop and anjuta but they only
autocomplete previous declared variables. I would like to avoid using
emacs because of the wierd keymap.

Are there any alternatives left or are there no tradition for using
autocompletion when writing c++?

The following answer is what you get for not posting a Linux question to a
Linux newsgroup:

I would use Visual Studio, and would remote-mount the project folder with
Samba. Then I would create two build scripts, one with Visual Studio native
and the other for GNU Makefile. Then I would configure a script in Linux to
run that Makefile each time my source files change.

Then I would tile Visual Studio and a Konsole (running in a remote CygWin X
server on my Windows desktop) so I can see the source in one window and the
script in another. Then I would write unit tests and run them simultaneously
in both environments. Oh, and if I don't screw up the Visual Studio
settings, I would typically get Intellisense.

The absurdity of that answer (compounded by the absurdity of I have actually
done all that) is compounded by the fact that this newsgroup is not
qualified to defend you from anything I said, if I got any of these details
wrong. No detail there has anything to do with the raw C++ language itself,
which is the only thing this newsgroup is qualified to discuss!
 
D

dave_mikesell

Are there any alternatives left or are there no tradition for using
autocompletion when writing c++?

Do you really type in code without knowing what you classes/member
functions you are about to use?
 
Z

Zeppe

Do you really type in code without knowing what you classes/member
functions you are about to use?

I do, for example. What's wrong with that? It's not professional?

Regards,

Zeppe
 
G

Gernot Frisch

Do you really type in code without knowing what you classes/member
functions you are about to use?

I know them, but not the exact spelling mostly. Especially with 3rd
party classes.
FWIW, Visual Studio is the best with this. Don't know if it runs on
WINE e.g.
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

Do you really type in code without knowing what you classes/member
functions you are about to use?

Are you saying that you know all the classes, members and functions in
standard C++, plus whatever other third part libraries you might be
using? There are several usages of autocomplete, one is that you don't
have to know the exact names of all members and functions and stuff of
all the classes that you might encounter. What's important as a
programmer is that you know that there is a method that does what you
want, and if you have an idea about the name that's just a bonus.
Another useful feature of autocomplete is that you don't have to spell
out all of InvalidDeviceSettingException or whatever.
 
Z

Zeppe

Gernot said:
I know them, but not the exact spelling mostly. Especially with 3rd
party classes.
FWIW, Visual Studio is the best with this. Don't know if it runs on
WINE e.g.
Unfortunately it doesn't. I've failed as well finding a good linux C++
IDE. Now I'm using kdevelop + kdbg, but I'm not fully satisfied.

Regards,

Zeppe
 
D

desktop

Zeppe said:
Unfortunately it doesn't. I've failed as well finding a good linux C++
IDE. Now I'm using kdevelop + kdbg, but I'm not fully satisfied.

Regards,

Zeppe

Have you tried Code::blocks or eclipse with CDT?
 
Z

Zeppe

desktop said:
Have you tried Code::blocks or eclipse with CDT?

Eclipse + CDT is intolerably slow in performing the completion,
considering that now I'm working on a Pentium D 3.4GHz with 2 GB of RAM
memory.

Code::blocks is nice, but as KDevelop it can't stand with Visual Studio.
Let's say that Code::Blocks is a really valid product, but not a
professional product.

Regards,

Zeppe
 
D

dave_mikesell

I do, for example. What's wrong with that? It's not professional?

How often do you need it? Nice to have on-demand, maybe, but not
every time I type a . or -> or a ::.
 
Z

Zeppe

How often do you need it? Nice to have on-demand, maybe, but not
every time I type a . or -> or a ::.

well, this is another issue

That's why usually the small suggestion window opens after 0.5 seconds :p

Regards,

Zeppe
 
J

James Kanze

Do you really type in code without knowing what you classes/member
functions you are about to use?

What does that have to do with it? Auto completion makes a lot
less typing errors than I do. (Or it makes them consistently: I
noticed yesterday that I'd accidentally left out a letter in one
of my variable names. Thanks to auto completion, every
reference to the variable also left out the letter, and the code
compiled.)

The real question is whether there are editors around today that
don't support auto completion. I use it with vim, and I know
that emacs supports it. (The original vi doesn't, of course,
but I only know one person who's still using that for program
development.)
 
J

James Kanze

On 23 Apr, 13:42, (e-mail address removed) wrote:
Are you saying that you know all the classes, members and functions in
standard C++, plus whatever other third part libraries you might be
using?

I think he's saying that if you don't know the function, you
won't be using it (or shouldn't be using it).
There are several usages of autocomplete, one is that you don't
have to know the exact names of all members and functions and stuff of
all the classes that you might encounter.

Then you still have to look them up. Or does auto completion
also ensure that you have the right number of arguments, with
the right types, and that all of the additional constraints have
been met? (Things like not passing a null pointer if the
function says it's forbidden.)

I don't think that auto completion is a real help here.
What's important as a
programmer is that you know that there is a method that does what you
want, and if you have an idea about the name that's just a bonus.

That's more a feature of your help, or whatever. If you know
(or even think) that there's a function which does what you
want, you'll want to see its documentation to be sure before
using it.
Another useful feature of autocomplete is that you don't have to spell
out all of InvalidDeviceSettingException or whatever.

And that you won't make a typo along the way. If you make the
typo in the first couple of characters, auto complete won't find
the match, so you can correct it immediately, and of course,
everything beyond that will match perfectly, because the program
does it, not you.
 
?

=?iso-8859-1?q?Erik_Wikstr=F6m?=

I think he's saying that if you don't know the function, you
won't be using it (or shouldn't be using it).


Then you still have to look them up. Or does auto completion
also ensure that you have the right number of arguments, with
the right types, and that all of the additional constraints have
been met? (Things like not passing a null pointer if the
function says it's forbidden.)

I don't think that auto completion is a real help here.

Well, that depends on what you mean by autocomplete, when I use the
term I think of what MS calls Intellisense, which in fact gives you
the number and type of arguments for methods. What it can't do is is
ensure that those other constraints have been met, but with most well-
designed APIs you can usually guess the constraints.
That's more a feature of your help, or whatever. If you know
(or even think) that there's a function which does what you
want, you'll want to see its documentation to be sure before
using it.

I was more thinking about cases where you are not sure if the function
is called Foo(), OnFoo(), or DoFoo() or what the order of the
arguments are. There are of course always a need for good
documentation, but in many cases the signature of a function can tell
you all you need to know.

Also if you are working with a collection and there's a method sort()
you can be pretty sure it will sort the collection, add() will add an
item and so on, in these cases you really don't have to look in the
documentation.
 
J

josh

I use Ubuntu 7.04 and have trouble finding a good editor that has
autocompletion (when typing std:: or using "." on strings or pressing
ctrl+space).

I have tried eclipse with CDT 3.1.2 but it takes about a minute before
the popup box appears. I have also tried KDevelop and anjuta but they
only autocomplete previous declared variables. I would like to avoid
using emacs because of the wierd keymap.

Are there any alternatives left or are there no tradition for using
autocompletion when writing c++?

Try cdt 4.0 the popup appears in few seconds.
Bye
 
J

James Kanze

On 24 Apr, 09:38, James Kanze <[email protected]> wrote:

[...]
Well, that depends on what you mean by autocomplete, when I use the
term I think of what MS calls Intellisense, which in fact gives you
the number and type of arguments for methods.

In my source code? I'd just have to delete them then. You must
mean something else.
What it can't do is is
ensure that those other constraints have been met, but with most well-
designed APIs you can usually guess the constraints.

With a well designed API, you can even guess the name and the
arguments:). Regretfully, well designed API's seem to be
rather rare.
I was more thinking about cases where you are not sure if the function
is called Foo(), OnFoo(), or DoFoo() or what the order of the
arguments are.

I'm not sure about what you're describing. If you don't know
even the beginning of the function name, what do you type in to
get the completion? Are you saying that if I type Foo, then
request autocompletion, the editor will replace it by OnFoo, if
that's what the function is called?
There are of course always a need for good
documentation, but in many cases the signature of a function can tell
you all you need to know.
Also if you are working with a collection and there's a method sort()
you can be pretty sure it will sort the collection, add() will add an
item and so on, in these cases you really don't have to look in the
documentation.

True, but for those sort of functions, I typically don't need
auto-completion either:).
 
D

dave_mikesell

What does that have to do with it? Auto completion makes a lot
less typing errors than I do. (Or it makes them consistently: I
noticed yesterday that I'd accidentally left out a letter in one
of my variable names. Thanks to auto completion, every
reference to the variable also left out the letter, and the code
compiled.)

In some client code I modified years ago, a structure member with
"Count" in the name was missing the 'o'. Would have made for
embarrassing code reviews had I not changed it. I think that was
more language barrier than auto-complete error, but your anecdote
reminded me of it. :)

Maybe I'm confusing terms. I'm mostly thinking of the feature that
wants to invoke the little window every time you type a . or ->.
Maybe I had the threshold set too low. Maybe I complain too much.
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

[...]
Then you still have to look them up. Or does auto completion
also ensure that you have the right number of arguments, with
the right types, and that all of the additional constraints have
been met? (Things like not passing a null pointer if the
function says it's forbidden.)
I don't think that auto completion is a real help here.
Well, that depends on what you mean by autocomplete, when I use the
term I think of what MS calls Intellisense, which in fact gives you
the number and type of arguments for methods.

In my source code? I'd just have to delete them then. You must
mean something else.

Sorry, but it seems like we've lost lost each other somewhere along the
way, because I can't figure out what you are talking about :)

I'm not sure about what you're describing. If you don't know
even the beginning of the function name, what do you type in to
get the completion? Are you saying that if I type Foo, then
request autocompletion, the editor will replace it by OnFoo, if
that's what the function is called?

I think I see where the confusion is coming from. You are talking about
simple autocompletion where the editor deducts what you are going to
type and fills it in for you whereas I'm talking about something more
advanced. As an example consider this piece (incomplete) of code:

std::vector<int> vec;
vec.

Now, Visual Studio it knows that vec is of type std::vector<int> and
what members it has, so as I type the '.' a list appears with all the
members, and as I start typing the word 'insert' (in this case as soon
as I type the 'i') insert will be selected in the list. When the member
I want is selected I press Enter without typing the whole name.

Next as I type the opening parenthesis I get a tool-tip telling me that
there are 3 overloaded versions of this function and the first has the
signature 'vector<_Ty,_Ax>::iterator insert(vector<_Ty,_Ax>::iterator
_Where, const _Ty& _Val)', using the arrow-keys I can get a tool-tip
describing the other versions of insert.

When writing C# Intellisense is even smarter and can deduct a lot more
and you can write very long lines typing only a few characters.
 
J

James Kanze

On 24 Apr, 09:38, James Kanze <[email protected]> wrote:
[...]
Then you still have to look them up. Or does auto completion
also ensure that you have the right number of arguments, with
the right types, and that all of the additional constraints have
been met? (Things like not passing a null pointer if the
function says it's forbidden.)
I don't think that auto completion is a real help here.
Well, that depends on what you mean by autocomplete, when I use the
term I think of what MS calls Intellisense, which in fact gives you
the number and type of arguments for methods.
In my source code? I'd just have to delete them then. You must
mean something else.
Sorry, but it seems like we've lost lost each other somewhere along the
way, because I can't figure out what you are talking about :)

If the editor goes about inserting the number of arguments a
function takes in my source code, I'm not sure I'd like that.

But it was already clear to me that you must have meant
something else, but no one would like that, really.
I think I see where the confusion is coming from. You are talking about
simple autocompletion

I'm talking about auto-completion, where the editor
automatically completes something you've started typing.
where the editor deducts what you are going to
type and fills it in for you whereas I'm talking about something more
advanced. As an example consider this piece (incomplete) of code:
std::vector<int> vec;
vec.
Now, Visual Studio it knows that vec is of type std::vector<int> and
what members it has, so as I type the '.' a list appears with all the
members, and as I start typing the word 'insert' (in this case as soon
as I type the 'i') insert will be selected in the list. When the member
I want is selected I press Enter without typing the whole name.

I'm not sure I'd want it to pop up a list systematically; I know
vector well enough that it would just be visual clutter. But
having a hot key for it to do so does sound nice.

Can it handle user defined classes as well? Under what
conditions? (Obviously, I presume that it the collegue hasn't
yet written the .hpp file, it won't be able to say much:). On
the other hand, I can imagine something like that being very
helpful with third party libraries, like wxWidgets.)
Next as I type the opening parenthesis I get a tool-tip telling me that
there are 3 overloaded versions of this function and the first has the
signature 'vector<_Ty,_Ax>::iterator insert(vector<_Ty,_Ax>::iterator
_Where, const _Ty& _Val)', using the arrow-keys I can get a tool-tip
describing the other versions of insert.

Again, I'd rather have to ask for it (and I'm not sure that a
tool-tip is the way I want to see it), but the basic idea of a
context sensitive help is nice. (Vim has some support for this,
but I've not had the occasion to use it, so I can't say how good
it is.)
 
?

=?ISO-8859-1?Q?Erik_Wikstr=F6m?=

I'm not sure I'd want it to pop up a list systematically; I know
vector well enough that it would just be visual clutter. But
having a hot key for it to do so does sound nice.

I think that is configurable somehow, I've just never bothered.
Can it handle user defined classes as well? Under what
conditions? (Obviously, I presume that it the collegue hasn't
yet written the .hpp file, it won't be able to say much:). On
the other hand, I can imagine something like that being very
helpful with third party libraries, like wxWidgets.)

If it has the .h file it will generally work, sometimes it takes a
little while before it updates the database and sometimes it fails but
it does recognize all of my types in my current project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,609
Members
45,253
Latest member
BlytheFant

Latest Threads

Top