View Single Post
Old Aug 31st, 2007, 10:10 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
One makes a project modular for the programmer(s) and for efficiency. I'm not one of those who thinks every function should be in a separate file, but a file should be relatively comprehensible in its entirety.

For large programs (I imagine my idea of a large program is a little different from the average member's), incorporating changes is faster if source files are smaller. One only has to compile those files that have been changed, then relink.

One might consider the GUI to be a single piece, but that isn't necessarily the case. The code that represents the action for some event may have no relationship to that for another event. Code for generation a report, for instance, should not be in the same file as code for ramping up the motor speed according to some rate curve. Both, however, interface to the GUI for input and output/display.

As for GUI programming being a pain in the ass, I disagree. Try making a really slick and easy to use console app for something other than a trivial hobby-type program.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote