Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I really hate plural table names. There are two common problems plural table names have. First, as janus mentioned, plurals in English can be irregular. A common real-world example is "people" and "person". If I have a table named "People" I'll probably end up referring to "person_id" as well, which just irritates me.

    Another problem is that it degrades badly when you have "linking" tables. Say I have Accounts and Users, then I might have an AccountsUsers table. Yuck! If I have Accounts, Users, and Roles, then I could have AccountsUsersRoles. Double yuck! And if that table needs it's own surrogate key, is it accounts_users_roles_id? Pure madness.
    • The proposed standard naming convention from $cow_orker also mandated the use of CamelCase. With the added wrinkle of a short suffix on every table name. E.g.: Account_act or ProductCommissionGroup_pcg. Any advance on Triple-Yuck ?

      • I just barfed on my keyboard...thanks.
      • I do like camel case for table names, as a way to distinguish them from column names. This is very similar to the the Perl standard of camel case for package names.

        That suffix thing is truly awful, though. What possible purpose could it serve? It's like naming everything twice.
        • The aforementioned proposed standard justified camel case for table names in the same way - to distinguish them from column names. I found that argument a bit spurious since a) I don't recall ever confusing column names for table names and b) the table names are easy to identify already - they're the words following the FROM and JOIN keywords :-)
        • It seems that most databases make table names case insensitive unless you go out of your way to use " everywhere. So using camelCase becomes an unenforced convention that is then not maintained. You also have the potential problem that a given name could be broken into English words in multiple ways, making capitalization ambiguous.

          This is why I prefer using _ instead.

          For the record, note that my job involves a lot of reporting. I spend more time writing SQL than Perl.
          • It seems that most databases make table names case insensitive

            Yeah, except for a particular free-of-charge database that seems to be quite popular. Tables are files on the underlaying filesystem, and if the underlaying filesystem is case sensitive, your tables are as well. Columns, OTOH, aren't case-sensitive.

            • Yeah, except for a particular free-of-charge database...

              ...and a certain well-known commercial database (*cough* Sybase *cough*). There is a global switch you (i.e. the DBA) can flip to change that, but then all havok breaks loose...