Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Basic Coding Tips: Parsimonious Parameterization

by stvn (Monsignor)
on Jan 28, 2005 at 21:58 UTC ( #426134=note: print w/replies, xml ) Need Help??

in reply to Basic Coding Tips: Parsimonious Parameterization

Very nice.
Superfluous 'Status Flags

I cannot tell you how many times I have encountered this issue. And not only does it complicate things from the user side (as you described), I have found it many times makes code totally unreadable. You example shows only one flag, but I have dealt with code and database tables which had 5 or more flags. The justification is usually that it "speeds things up", but this is a classic case of premature optimization.

  • Comment on Re: Basic Coding Tips: Parsimonious Parameterization

Replies are listed 'Best First'.
Re^2: Basic Coding Tips: Parsimonious Parameterization
by Anonymous Monk on Feb 09, 2005 at 03:13 UTC
    I'm not sure anybody will read this, since I'm a bit late. However, the term 'superfluous' status flags is a little bit indescriptive. For instance, I find the status flags in Apache::Session to not be superfluous, but then again I'm sure they could be replaced... how do you define superfluous in this case? Are they status flags that lead to mistakes in code logic? Aren't all mistakes in code logic a problem? What 'superfluous status' flags simply aren't mistakes in code logic rather than "Parsimonious Parameterization."

      Superfluous status flags are those which can readily be inferred from the rest of an object's state. They denormalize the data structure (in relational database terms) and the additional code required to update them in sync with the actual data violates the Once And Only Once principle.

      Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://426134]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2018-01-16 21:43 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (192 votes). Check out past polls.