Quote:
Originally Posted by guynorton
Thanks for the replys.
Chroniclemaster1:
I think I will go the uniqueID path for the reasons you mention.
I would have expected there to be a consensus of opinion on something that lies at the very foundation of good database design, yet the difference in opinions and the intensity of them is unexpected to say the least.
|
Hahaha. :) Yeah, you'll find that on a number of issues. As much as programming is about dealing with technical (in some sense scientific) details you'd think these things were "solved" just like you solve a math problem. The thing is that different programmers have different priorities, so a solution that makes total sense to one person because it solves their priorities, seems totally ridiculous to someone else who thinks differently. :) That's why people argue about Mac vs. PC, Windows vs. Linux, MS vs. Apple vs. Open Source, OOP vs. Procedural, frameworks vs. programming, etc., etc., etc.
Quote:
Originally Posted by guynorton
Personally I feel, as you do, that it reduces complexity and for someone such as myself who can be muddleheaded at the best of times, this is a big advantage!
|
:D This is almost word for word from a great book on programming, Steve McConnell's
Code Complete 2. The number one rule in computer programming is to minimize complexity. McConnell has a lot of excellent tips and techniques for achieving that too, which is why it's part of my quick reference shelf, but in particular I think this rule is right on.
There are all kinds of guys who are absolutely brilliant; they're SO much better than I am. I've seen the code they write. It's completely amazing. I would never be smart enough to write code like that. But here's the problem... nor would I ever be smart enough to maintain code like that. And because two equally smart developers still
think differently there aren't many OTHER people who can either.
That's why I agree you should minimize the complexity of your code. I try to program defensively, which means that if your code isn't clear, obvious, simple to understand, people will find ways to misunderstand it.
Quote:
Originally Posted by guynorton
Oldpedant:
I never actually considered separate tables for location and function. This may have been intuitive because as desirable as normalized data is these fields will play such a limited role in the finished product that I fear normalizing them may bring unnecessary complexity with no tangible gain.
|
I actually like the separate tables. It is a little more complicated but not much, and it ensures that a simple misspelling doesn't ruin your database data (because that's all it takes to lose data).
Think of it this way, if you're putting everything in one table, it's just like a spreadsheet. That's not just
a problem, it was THE problem which inspired people to develop the relational database in the first place. With all the names inserted, you have data that is right, data that is wrong, and data that is
almost right. That's the problem with spreadsheets, because it's easy to fix the stuff that's wrong, it's finding the stuff that "looks" right but isn't. In a database where you refer to the ID numbers, you dump out a query and the things which are wrong stick out like a sore thumb because you've effectively eliminated the category of "almost right" from the equation. You either have the correct ID or you don't.