in reply to Size of inside out object

I advise that you let your decision be governed, first by the overall simplicity of the resulting application, and second by avoiding the need to unnecessarily store “default” values.   If you know that a car is Red unless otherwise specified, you don’t need to store Red.

I suggest that you use a true Perl object, unless you truly don’t know what the set of attributes might be.   Here, in “getter” and “setter” routines, you can easily specify whatever logic you need, and do it but once.   Perl’s “blessing” technique is good and efficient.

Obviously, some edge-cases of computer programming do from time to time present us with situations where “microseconds matter profoundly,” and the amount of storage that we must for one reason or another consume in-memory is enormous.   But if it isn’t, then let concerns of simplicity, reliability, and maintainability win the fight over concerns of space and speed.

Replies are listed 'Best First'.
Re^2: Size of inside out object
by BrowserUk (Patriarch) on Jun 06, 2012 at 22:30 UTC

    The petitioner asks: How many grams of unsaturated fats do your fast food product contain? And how does that compare with a similar meals that I can cook from scratch at home?

    Subtext: I'd like to know the (possibly mortal) costs of the convenience of your product.

    The fast food manufacturer diverts: Our products are wholly natural; contain 100% of your daily requirement of vitamin Z-obscure; and help employ many less well educated people in third-worlds countries.

    The idea that your perfect-world criteria and more important than the petitioners explicit, requested information is presumptuous in the least.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?