SQLServerCentral Editorial

Poor Names

,

It's always interesting to me when I give product feedback to engineers at Redgate on their demos. Quite often they've built a feature that uses AdventureWorks or Pagila (PostgreSQL) or some other well known schema to evaluate how their particular thing works with a database. I try to remind them that many databases aren't well modeled and designed with consistent naming.

I ran across a Daily WTF article that isn't showcasing databases, but it does show some poor naming in data being stored in a PDF. The developer who had to automate a process had to map these fields to database fields, which also might not be named very clearly. In fact, I think I've seen a few database models that used column names like the field names in the PDF.

Most systems we work on evolve over time. They aren't built by one programmer, or one team, across any period of time. Existing developers leave and new ones start. DBAs change, and we often don't have any code analysis rules enabled or running in CI that might help us with consistency.  Often we don't even have our rules documented.

Humans are amazingly creative beings, but they also get very uncreative when they have to repeat that creativity over and over. It's why we find a neighborhoods in Colorado with Pine St, Pine Ln, Pine Rd, Pine Circle, Pine Way, etc. You get the idea. Someone got bored and didn't want to be creative, so they just took the easy way out.

The same thing happens in databases. I've seen people have a Customer table and then a CustomerDetails table alongside it (singular and plural) with a custDefault (case) and a tblCustContact (prefix) table that leave me scratching my head. Did the next developer not look at the database at all? Certainly they didn't use any modeling tool like Redgate Data Modeler.

I don't blame others, since I've found myself struggling to be creative as well as consistent when I build systems. Sometimes I've got some automation running that reminds me to do better, but often I'm depending on another human to catch these inconsistencies in a code review. However, I'm not sure code reviews include looking at the name of the object for most people. Well, maybe column names, but that might be it.

I'd hope an AI system could recognize poor names and then suggest better ones that capture the intent of the data being stored and look like the other objects in the database. Unfortunately, that will likely lead to a section in the database that looks amazing while all the older objects drive you crazy with their random nature. Maybe the AI can at least update the comment or description fields in code to ensure there's some place to look for information to help us do better in the future.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating