On Sat, Apr 26, 2008 at 08:33:28PM -0400, Robert Treat wrote:
> enum types custom ordering. It also showcases the idea of data definitions
> that "should never change", but that do changes every half dozen years or so.
> Now you can argue that since it is expected that the ratings might change in
> some way every few years that an enum type is not a good choice for this, but
> I feel like some type of counter-argument is that this is probably longer
> than one would expect thier database software to last. :-)
I think that if you are building software on the premise that it's
only going to last five years, you oughta have a look around on the
Internet again. Or think about why banks spent the money they did a
few years back poring over ancient code making sure that two-digit
year representations weren't in use.
You can _of course_ make this sort of trade-off: the cost of the
upgrade might be worth the natural ordering and boost in performance.
But that was part of my point when noting that enums oughta come with
a warning (and why I compared them to char()). I'm not arguing that
they're completely useless; just that, like any oddly specialised
tool, they require careful use.
A
--
Andrew Sullivan
ajs@commandprompt.com
+1 503 667 4564 x104
http://www.commandprompt.com/