Stop naming your variables 'a', 'b', 'c'.. .etc. One letter variables are horrible and make it easy to make mistakes. Give them normal names like 'row' and 'column'.
1) Put a little bit of white space in there. What's easier to read? This
Code:
for(int i=0;i<10;i++)
or this
Code:
for( int i=0; i < 10; i++ )
Be consistent in your formatting.
2) Do your curly braces indent one level from the statement or not?
Is it
Code:
for(int i=0;i<10;i++)
{
}
or
Code:
for(int i=0;i<10;i++)
{
}
Pick a style and stick with it. Formatting is very important because good, consistent formatting can help with code readability. And readability leads to maintainability.
1) Put a little bit of white space in there. What's easier to read? This
Code:
for(int i=0;i<10;i++)
or this
Code:
for( int i=0; i < 10; i++ )
Be consistent in your formatting.
2) Do your curly braces indent one level from the statement or not?
Is it
Code:
for(int i=0;i<10;i++)
{
}
or
Code:
for(int i=0;i<10;i++)
{
}
Pick a style and stick with it. Formatting is very important because good, consistent formatting can help with code readability. And readability leads to maintainability.
very nice suggestions Arjay ,infact when I started writing this code I had in my mind to make the code as readable as possible, I had plan to add comments so that any one can easily understand it. But once I start writing, debugging and making algorithm for the code simultaneously I could'nt manage to stick with my plan and once I finished it I found it boring to decorate it
anyways this was my first project I'll try to make my codes more readable next time.
regards
Last edited by emenent; September 1st, 2009 at 07:22 PM.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.