Code Shine

Current Version (0.2)

1st May 2004

This new version is something that works OK for me. It was a bit harder than expected to get this version together, leading to the 0.2 quote:

"All you need is ignorance and confidence and the success is sure." --Mark Twain

What it Does

Currently Code Shine will:

What it Doesn't Do (Yet)

Examples

Test 1 Before

#include 

namespace
	bob 
		{
			class C;
		}

int
f2()
{
    // Simple for, no body
    for(int i=0; i < 10; ++i);
    
    // For with body
 for   (int i=0; i < 10; ++i)
        std::cout << i << std::endl;

    if (1==1)
	    std::cout << "true" << std::endl;

    // For, K&R style
    for (int k =0;k<12; k++) {
    std::cout << k;
        std::cout << std::endl;
        if (k > 7) {std::cout << "k greater than 7" << std::endl;}
    }        
     
    // Deliberately have incorrect logic here
    if (1==0);
        std::cout << "1==0" << std::endl;
    

        int z=0;        while  (z<    9)
                
{
    std::cout << "z " <<
                    z << std::endl;
    int b=1;
    do    { std::cout << "B " << b << std::endl; 
    b++;
  } 
    while 
            (b < 3);
    ++z;
}
   
        }

int main() { f2(); 
}

Test 1 After

#include 

namespace
bob
{
    class C;
}

int
f2()
{
    // Simple for, no body
    for(int i=0; i < 10; ++i);

    // For with body
    for   (int i=0; i < 10; ++i)
        std::cout << i << std::endl;

    if (1==1)
        std::cout << "true" << std::endl;

    // For, K&R style
    for (int k =0;k<12; k++) {
        std::cout << k;
        std::cout << std::endl;
        if (k > 7) {std::cout << "k greater than 7" << std::endl;}
    }

    // Deliberately have incorrect logic here
    if (1==0);
    std::cout << "1==0" << std::endl;


    int z=0;        while  (z<    9)

    {
        std::cout << "z " <<
        z << std::endl;
        int b=1;
        do    { std::cout << "B " << b << std::endl;
            b++;
        }
        while
            (b < 3);
        ++z;
    }

}

int main() { f2();
}

The Older Version (0.1) page is still available