Slashdot Mirror


Eclipse Finally Gets Code Folding

binarysearch writes "Code folding is finally in the Eclipse project! After more than two years open, Eclipse's Bug 9355 has finally been marked FIXED. Code Folding was the most-voted for bug in Eclipse, with support for J2SE 1.5 features in a close second. Check out the I20040504 Integration build for folding in the Compilation Unit Editor (Class File Editor support is in HEAD). For those who dislike the implementation, it is requested that you create a new bug, rather than reopening 9355."

4 of 90 comments (clear)

  1. Re:questionable features by ClosedSource · · Score: 2, Funny

    "Several people complained Eclipse wasn't usable because it didn't have folding... Needless whining serves no one any good."

    Since the desired feature was implemented, the "whining" was apparently quite effective.

  2. Code Density by kmsigel · · Score: 2, Funny

    I have never used code folding. What I do is (of course) try to keep basic blocks short and focused. In addition, I make my code dense by putting multiple short statements on one line if they are related. (Statements that appear near each other are usually related.) I also place a group of several short statments that are the target of an if/while/etc on the same line as the if/while/etc.

    What this does is fit a lot more code in the same number of lines (not recommended for LOC whores), meaning you see a lot more code on screen at once.

    Here is an example of code I wrote yesterday:

    KError error; ichar c;
    Loop: if (error = Read(&c)) return error;
    if (KIsFlagSet(readMode,fModeAuto)) {
    if (KIsFlagSet(readMode,fModeTwo)) {
    if (KIsFlagSet(readMode,fModeCR)) {
    if (c == CR) { readMode = cModeTextLFCR; goto Loop; }
    else readMode = cModeTextLF;
    } else {
    if (c == LF) { readMode = cModeTextCRLF; goto Loop; }
    else readMode = cModeTextCR;
    }
    } else if (c == CR) {
    readMode = cModeTextAuto | fModeTwo | fModeLF; c = LF;
    } else if (c == LF) {
    readMode = cModeTextAuto | fModeTwo | fModeCR;
    }
    } else if (c == CR) {
    if (KIsFlagSet(readMode,fModeCR)) c = LF;
    else if (KIsFlagSet(readMode,fModeToss)) goto Loop;
    } else if (c == LF) {
    if (KIsFlagClear(readMode,fModeCR)) ;
    else if (KIsFlagSet(readMode,fModeToss)) goto Loop;
    }

    1. Re:Code Density by turgid · · Score: 2, Funny

      Argh! It's FORTRAN written in Java! Quick, sprinkle the Holy Water...

    2. Re:Code Density by AvantLegion · · Score: 2, Funny
      Argh! It's FORTRAN written in Java!

      <p>
      Don't worry - Java's garbage collector will take care of that garbage...
      <p>