But well, anyway, i would like to try and process the data "on the go" (while reading it) if possible, as it represents a kind of "design challenge".

So, you realize that processing the data "on the go" will make for a complicated design. For me, that means "bad design" not "design challenge".

You don't get better at design by flexing your design muscles trying to do a really good job at figuring out a design for an overly complex problem.

You get better at design by learning how to recognize the most simple and cohesive parts of a problem and how to factor them out so that the parts left to be designed are fewer and/or smaller until you get to the point that everything is simple to design.

When I see something that is complicated to design, my primary reaction is to assume that things have been factored badly and reconsidering how some things have been factored is the best next step because factoring them "better" may leave me with a much simpler design problem.

Complex design problems that don't get factored into a bunch of simple design problems with minimal interconnectedness turn into complex designs and complex software and repeated failures.

That is, the correct design step when given the design challenge you gave to yourself is to say "Doing calculations 'on the fly' makes things complicated and makes it harder to separate concerns and so makes for less modular design. Is there a fundamental reason that calculations have to be done 'on the fly'? If not, we should just drop that idea from the design."

Congratulations, you will have successfully solved your design challenge when you drop it.

- tye        


In reply to Re: Design elegance : How to best design this simple program ? (modular) by tye
in thread Design elegance : How to best design this simple program ? by mascip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.