Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: On Quality

by Aristotle (Chancellor)
on Feb 23, 2006 at 08:48 UTC ( #532217=note: print w/ replies, xml ) Need Help??


in reply to Re: On Quality
in thread On Quality

Always design for zero, one, or many inputs.

Can you explain this in more detail? I think I have a rough intuition about what that statement means, but itís too vague to be very revealing.

Makeshifts last the longest.


Comment on Re^2: On Quality
Re^3: On Quality (0,1,N)
by tye (Cardinal) on Feb 24, 2006 at 07:30 UTC

    It means, "avoid arbitrary limits", but the concreteness of "0, 1, or unlimited" is a useful benchmark.

    There are sometimes fundamental reasons for imposing limitations like "there can be at most one X per Y" (0 or 1), "there must always be exactly one X for each Y" (1), "no Y can ever have an X" (0). While limitations like "a Y can never have more than 5 Xs" are most often just arbitrary limits.

    Arbitrary limits very often come back to bite you. So it is good to have at least some motivation to do the extra (or perhaps just "different") work up-front to eliminate such arbitrary restrictions.

    So being at least suspicious of any "at most N" (for N > 1) restrictions is a good habit.

    Of course, sometimes 0 or 1 limits are actually arbitrary and (rarely) specific finite limits above 1 are not arbitrary. But the "0, 1, or unlimited" test is very useful.

    - tye        

      Ah. That is a lot more concrete than the idea I had in mind, though on reflection, it is the same principle.

      This particular thing is something Iíve been doing instinctively Ė f.ex. one of the reasons to prefer dynamic, garbage-collected languages is that they tend to make this much easier, whereas in something like C, itís generally a lot less work to pick arbitrary limits. But I hadnít thought about it in such concrete terms, and I agree that the concreteness is useful.

      Thanks for the explanation.

      Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://532217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2014-08-28 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls