gnosti has asked for the wisdom of the Perl Monks concerning the following question:
Right now all my code (except the GUI widgets part) is procedural, using hashes and arrays to store data. I am implementing two operating modes:
* A Tk GUI event loop
* A command-line parse-and-execute loop
My code, already close to 4k lines, is sprouting such conditionals as:
At the moment I have only about ten of these statements. Should I think about trying to eliminate them? What are my alternatives?&refresh_track_display if $gui;
This is a concern as I am considering an incremental move over to a OO style and higher levels of abstraction. How might OO design or some other abstraction help me support this dual-interface ability?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Eliminating conditional code for GUI and text-mode operation
by ikegami (Patriarch) on Dec 07, 2007 at 07:13 UTC | |
by gnosti (Chaplain) on Dec 07, 2007 at 09:50 UTC | |
by gnosti (Chaplain) on Dec 08, 2007 at 09:09 UTC | |
by ikegami (Patriarch) on Dec 08, 2007 at 14:06 UTC | |
|
Re: Eliminating conditional code for GUI and text-mode operation
by graff (Chancellor) on Dec 08, 2007 at 02:25 UTC | |
by gnosti (Chaplain) on Dec 08, 2007 at 09:13 UTC |