Re: The BOOLEAN data type

From: Paul <paul_at_not.a.chance.ie>
Date: Fri, 4 Apr 2003 20:13:56 +0100
Message-ID: <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.  

> > How does one "compute" gender?
 

> Personally, I have no objection to storing redundant or derived data.
> Indexes do it. Snapshots do it. ... I guess I don't know who "we" is. Since
> you cut the attribution, I don't even know who "he" is.

The person to whom I was replying was Mr Celko IIRC.  

> To answer your question: One might derive gender a number of ways depending
> on the data modelled--by counting Y chromosomes, for instance. In Ontario,
> one can derive gender from a driver's license number.

And in France, it's part of the Social Security number. Alors?

Paul...

-- 

plinehan__AT__yahoo__DOT__com
Received on Fri Apr 04 2003 - 21:13:56 CEST

Original text of this message