C: IDE of choice


I used to use gedit as C IDE, I still use vim, but today I’d like you to try eclipsecdt.
It has the benefit of highlighting the line of errors and being able to jump there, rebuilding with a keystroke (Ctrl-B) without leaving the window and providing a tree view. So far, lots of C IDEs do that. anjuta for example. The thing that made the difference for me is that eclipsecdt provides completion for structs (functions too) when you haven’t written any letter yet. For example “mystructp->”(Ctrl-Space). I had a look at anjuta and BLOCKS.
Further, the outline (functions, structs, directives in the file) is nice as well as a very good preprocessor expansion/preview. Eclipsecdt also has a sufficient method of autoformatting your C code and also respects your preprocessor code.
So if you have

#define IFDEBUG if(1)
IFDEBUG
printf("blah");

depending on your settings, printf will be intended.

Last word: Intend with tabs and indent “case:”. If you don’t, you are wrong :-).
Edit: typo.

  1. #1 by panzi on April 19th, 2009

    As a matter of fact I only intend to indent with tabs. ;)
    However, I do not indent “case:”. I usually indent code between { } by one tab. So this would lead to:

    switch (x) {
    case FOO:
    return y;
    case BAR:
    case BAZ:
    z += y;
    default:
    return z;
    }

    Well this is ugly. Instead I do:

    switch (x) {
    case FOO:
    return y;
    case BAR:
    case BAZ:
    z += y;
    default:
    return z;
    }

    PS: Everything else is a criminal indent. :P

  2. #2 by JohannesBuchner on April 19th, 2009

    REPLY:
    You are doing it wrong.

    switch (x) {
    case FOO:
    return y;
    case BAR:
    case BAZ:
    z += y;
    default:
    return z;
    }
(will not be published)

  1. No trackbacks yet.