On Tue, 18 Nov 2003, HELSER ERIC JOSEPH wrote:
> I never did understand why programmers needed to use separate files for
> things... why did you use them for a FCS?
>
Traditionally multiple modules were used by C programs to fasten the
compilation speed and many times to even make sure compilation can be done
without excessive swapping and a very long time. Tools like make allow you
to compile only the modules that were changed, and then to link them to
the rest of the already compiled modules that did not change.
Later on, the concept of static libraries and shared objects (or DLLs)
became popular, that enabled several programs to link against this
pre-compiled code, without having to compile it themselves. (or in the
case of shared libraries, even include it).
But, moreover, splitting the program into modules and defining
well-defined interfaces for them to communicate with each other, enables
a program to be desinged better. By putting every separate component in
its own file, you can make sure it is a standalone, modular component.
You can find a list of the components of Freecell Solver and what they do
here:
http://fc-solve.berlios.de/arch_doc/fcs_arch_doc/x88.html
http://fc-solve.berlios.de/arch_doc/fcs_arch_doc/x143.html
As you see there are many utility components that are contained each in
his own class. Moreover, the core components of the solver are separated
to allow for better maintainability.
> Personally, my style of programming has always been "quick and dirty"- do
> as little as it takes to get the program up and running, regardless of
> future readability.
>
Well, whatever. Freecell Solver started in a very similar way. Later on,
though, it was heavily refactored, extended and revamped.
> My program seems to be fairly stable at 455 lines long...
> One thing I absolutely hate about all programming languages that is if
> you want to see text displaying, showing progress, it cuts processing
> speed by 90+%. Running "blind" (without seeing progress) is really
> irritating right now, as I don't know whether the program is working or
> stalling.
>
You can easily set a status message to be displayed every 100 iterations
or so. Moreover, you can give some command line flags to control it.
Regards,
Shlomi Fish
>
>
> To unsubscribe from this group, send an email to:
> fc-solve-discuss-unsubscribe_at_yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
----------------------------------------------------------------------
Shlomi Fish shlomif_at_vipe.technion.ac.il
Home Page:
http://t2.technion.ac.il/~shlomif/
An apple a day will keep a doctor away. Two apples a day will keep two
doctors away.
Falk Fish
Received on Tue Nov 18 2003 - 07:28:27 IST