Re: The BOOLEAN data type

From: Alan <alan_at_erols.com>
Date: Tue, 8 Apr 2003 15:25:11 -0400
Message-ID: <b6v7ml$8mo12$1_at_ID-114862.news.dfncis.de>


"Monte Gardner" <Monte.Gardner_at_asu.edu> wrote in message news:ee5e1a69.0304081048.68603852_at_posting.google.com...
> Paul <paul_at_not.a.chance.ie> wrote in message
news:<MPG.18f7b403e8268d469896b5_at_news1.eircom.net>...
> > bbadour_at_golden.net says...
> >
> >
> > > > I'm confused here! Why is it bad?
> >
> > > > I'm working on a project where we store people's gender - what's
wrong
> > > > with using a boolean for that?
> >
> >
> > > Because gender is neither true nor false.
> >
> >
> > What about a field HasYChromosome - and please don't tell me about
> > various chromosomal disorders that can lead to attributes of maleness
> > despite having no Y chromosome or vice versa - this has little relevance
> > in the real world.
> >
> >
> > > It is male, female, neuter,
> > > partially transgendered, gender reassigned male to female, gender
reassigned
> > > female to male, unknown etc.
> >
> >
> > This is essentially meaningless in the real world - "You've just had a
> > baby - boy or girl?" - not "Is it male, female, partially transgendered,
> > gender reassigned male to female, gender reassigned female to male,
> > unknown etc."
> >
> >
> > Knowing the sex of the person in the case of an app I'm working on at
> > the moment is important, since it is potentially necessary for possible
> > dormitory sleeping arrangements - i.e. the boys sleep in dorms with
> > other boys and vice versa.
> >
> >
> > > I suggest you choose an appropriate domain that represents the values
of
> > > interest and define the appropriate operations for the domain. The
boolean
> > > domain has two distinct values neither of which are male or female,
and it
> > > has operations such as conjunction and implication that have no
meaning for
> > > gender.
> >
> >
> > What about a table which stores bills? Paid or unpaid - that's a fairly
> > simple and important example of a boolean.
> >
> >
>
> Or, as in the case of a small School project I recently completed,
> let's say you have a table of product orders and you need to know
> which one's have been shipped and which one's haven't.
> That's a boolean value that can't be computed from other data.

Sure it can- from Shipped_Date:

IF Shipped_Date <= Today, then it's been shipped Else If Shipped_Date > Today, it has not yet been shipped, Else If Shipped_Date IS NULL, then we just don't know, but it looks like shipping is not in the works... Received on Tue Apr 08 2003 - 21:25:11 CEST

Original text of this message