RE: [Dev-C++] Programming Form/Style
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ya...> - 2001-02-25 22:43:45
|
main() is best to be used as the driver piece of the program with the rest things implemented in functions. Now if you have many couts (e.g. a menu) it is best implemented in a separate function. If you have 1-2 couts to test the functionality of the program place them in main(). Ioannis * Ioannis Vranos * Programming pages: http://members.nbci.com/noicys * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...]On Behalf Of Trevor Cook > Sent: Monday, February 26, 2001 12:10 AM > To: dev...@li... > Subject: [Dev-C++] Programming Form/Style > > > Hi, > > I am new to this list and very new to C++ and programming > in general, and I am wondering: > > My friend, who is also learning C++, told me that it is bad > programming form to declare class variables and functions public, > which I can understand for the sake of reusability and > simplicity. However, he also > told me it was bad form to let Main() do too much work and that > you should send as many tasks as you can to different > functions... Is this so? Why? I can see why for more complex > functions, but what about really > simple things. For example, should I even write simple output > functions to keep any "cout" lines out of main()? > > > Thanks for any help, > Trevor Cook > > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > http://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |