I tend to compile my main first before I've ever even defined any functions so I've always got a page to return to if I get lost. Anyone else do that? Or do some start laying out function definitions and variables first, and filling up main later?
Printable View
I tend to compile my main first before I've ever even defined any functions so I've always got a page to return to if I get lost. Anyone else do that? Or do some start laying out function definitions and variables first, and filling up main later?
I use main to coordinate my functions so there is really no point for me to compile it by itself
Hmmm. I guess it also depends on the project. If my program has some initial cin/cout conversation I do main. If it's just to process a file or calculate complex math without any cin I start with functions and build main later.
C++ is just silly.
I fail to see what, if any, value that adds to this thread.Quote:
C++ is just silly.
Main is usually the shortest function and is usually not altered in the code I work in so compiling it first really gains nothing. One practice I have gotten into is if I'm making a lot of changes in certain files in the solution I do tend to attempt to get them compiling by themselves first before attempting to rebuild the entire solution. I find it makes the errors a bit more manageable. Again I'm using MSVS 2003 which does not separate out the errors and warnings. 2005 and 2008 do separate them which makes the entire process a bit easier.