Use indentation and white space to show the logical structure of your program. There are a number of widely adapted formatting styles. Pick one and use it consistently. If you have trouble maintaining consistent indentation, use an editor that automatically indents your code. Many editors designed to be used by programmers include features such as syntax coloring and automatic indentation.
Programmers endlessly argue over which is the best programming editor.
The choice is a highly personal one. I use emacs . Emacs is far from perfect, but it is free, powerful and has been ported to virtually every operating system. But if you would like to give it a try, information on the Windows port of emacs can be found here . Other high quality programmer's editors are available for free or at low cost.