Advertisement

Switching IDE, having issue with "code completion"?

Started by October 20, 2014 07:51 AM
7 comments, last by FRex 10 years, 3 months ago

Hello

I don't know a name of IDE window that pops up that shows members of a class you are writing can you help?

For example when i have

//This is declared
class C
{
public:
    int m1;
    int m2;
};
std::vector<C> vec; 
//and i type
vec[ID].

when my input is after "." character i should get a list of all members (At least in visual studio i did) But in code blocks i don't, Cannot figure out why. Whats the name of the window that pops up, or do you know why i am not getting the member list when using vector in given case above.

The windows shows up with all data on some stuff, but on some stuff i cannot get anything even when i press ctrl + space.

Code::Blocks autocompletion has always been flaky for me whenever I used that editor, unfortunately. And, yes, it's called "code completion" (though that could be confused with autogenerated code), "autocompletion", or "intellisense" (due to that being the most obvious feature provided by the IntelliSense tools in Visual Studio).

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Advertisement
There are very few tools that have useful auto-complete support for C++. It's an incredibly difficult language to tool properly. I don't think you're going to find anything quite as good as Visual Studio in this arena (especially if you're using to running with the VAX plugin), though I'm told QtCreator also does a decent job. Even VS will fall flat on its face - VAX or no - if you using modern code or have a larger codebase.

Sean Middleditch – Game Systems Engineer – Join my team!

IDEs with good code completion: VS, QtCreator, Eclipse CDT.

I haven't been on the Code::Blocks forums for years, but if I remember correctly, they had their own parser, because they started before clang became a thing.

Having dabbled in writing an IDE on my own, I can tell that doing any code completion at all is very difficult. Most of the time you need code completion, the code is totally and utterly broken. There are strategies to cope with it, but you basically need very tight integration with the compiler, or your IDE will lag when the language spec changes.

If code completion is important for you, I'd advice you to use VS, Qt or CDT. I don't know why you would use anything other than Visual Studio on Windows, as in almost all cases it is free (as a student through DreamSpark, as a small business through BizPark, as MSDN subscription if you are a partner - that is, have enough Microsoft-certified employees through your local Microsoft branch).

Well thank you on suggestions, but only now i see how poor my request for help was, i should spent more time on it sorry for lack of information on my side.

Well after having massive issues with 32Bit windows, i switched to 64, and also switched IDE to CodeLite, now everything works fine, its code completion is as good as VS, so i am pleased.

If code completion is important for you, I'd advice you to use VS, Qt or CDT. I don't know why you would use anything other than Visual Studio on Windows, as in almost all cases it is free (as a student through DreamSpark, as a small business through BizPark, as MSDN subscription if you are a partner - that is, have enough Microsoft-certified employees through your local Microsoft branch).

Because VS is using allot of stuff that's non standard, and after we tried converting a project which has ~10k lines from VS project to Code::Blocks and CodeLite we had a job on our hands, and also we couldn't all work on it at same time, so the "Non standard" of the VS is so bad, i won't use the IDE. Even thou it can be set up to be using ISO. I did not find a easy tutorial so i decided to switch as well.

There are very few tools that have useful auto-complete support for C++. ... though I'm told QtCreator also does a decent job.

It does. Though it's not perfect and occasionally doesn't show what it should, it does a very decent job the majority of the time.

I've never used Visual Studio, so I can't compare to VS's one.

Advertisement

Because VS is using allot of stuff that's non standard, and after we tried converting a project which has ~10k lines from VS project to Code::Blocks and CodeLite we had a job on our hands, and also we couldn't all work on it at same time, so the "Non standard" of the VS is so bad, i won't use the IDE. Even thou it can be set up to be using ISO. I did not find a easy tutorial so i decided to switch as well.

Non-standard? How is VS non-standard? What specifically are you referring to? In terms of C++ a lot of the standard is generally very vague and will vary a lot from compiler to compiler.

The MSDN documentation clearly states whether a C function or C++ functionality is Microsoft-specific or not. Different versions of the compiler support different parts of the c++11 and the upcoming c++14 standards.

You can easily use Visual Studio to work on a cross-platform project. You'd use CMake/premake4 for project generation, but unless you want platform-specific code, everything can be written in Visual Studio. It has better tooling than anything any other IDE I've tried can offer anything even close. Also, the Visual Studio's debugger is very, very good. For cross-platform projects, the most annoying thing for me is not related to the compiler, but that Windows implements Unicode via UTF-16 rather than UTF-8. The reason for that, like is the case most of the time with Microsoft products, is that they implemented Unicode support in NT when it was believed that 16 bits are enough to represent all people will ever need. Since Java was first implemented around that time, it is also one of the few tech stacks that do implement Unicode via UTF-16, as well.

The other two prominent C/C++ compilers - GCC and LLVM/Clang - also have non-standard extensions. Just look up POSIX, the libc is full of it. The fact that your Linux build compiles just fine with MinGW is only because the compiler is the same, not because it is more "pure" C or C++.

If you are one of the people that just doesn't like Microsoft, I would really recommend QtCreator and Eclipse CDT. Both work very well, and it is a matter of taste whether or not you like Eclipse. From what I understand, CodeLite uses clang for code completion, which means it must work very well and support C++11 (if using a recent version). In case you actually do work on Linux, you can try KDevelop as well.

Generally, if you don't use Visual Studio, I advice you to use an IDE that integrates with clang. XCode uses it, QtCreator may use clang (wip/clang), KDevelop (5) is switching to it, there is a plugin (llvm4eclipsecdt) for Eclipse that uses it, CodeLite can use it. Clang was built from the ground up to support IDEs - with code completion, syntax coloring and refactoring. What is best, this is part of the compiler, so it understands the code very well and automatically supports new language features.

NetBeans has very good support for C++ completion too. It's a slow and big program but I couldn't use any other IDE after getting used to its' quality of completion and all the other features.

This topic is closed to new replies.

Advertisement