- Kevin Feasel
- Mala Mahadevan
- Mike Chrestensen
Notes: Questions and Topics
TriPASS Elections Forthcoming
This is an early warning for all TriPASS members that elections will be coming up. We’ll keep you posted with all of the details.
Mala and Tracy ended up on the Redgate 100 most influential database community people list. Congratulations to both of them.
Tibbling and Hungarian Notation
We went a bit further down into the topic of tibbling than I had expected but I think it was an interesting discussion. If you’re not familiar with the term, “tibbling” is prefixing tables with “tbl” in cases like
tblDocument. It’s a degenerate form of systems Hungarian notation.
We hit on two key things. First, is it as bad to use
IX_ as prefixes for constraints or indexes as it is to use
tbl for tables or
vw for views? My thought on the matter is, no and the reason is information. In general, we don’t need to distinguish between tables and views in queries—this is, in fact, one of the best things about views: we can query the as though they were tables. Furthermore, the tooling we have in SQL Server makes it really easy to see the list of tables and the list of views, meaning that a
tbl prefix doesn’t provide us any valuable information we could not easily get.
By contrast, the specific type of key constraint is a little harder to get. Yes, you could drill into constraints on a table in SSMS or Azure Data Studio, or you could query
sys.default_constraints to find out about specific constraint types. Similarly, you can query
sys.indexes to get details on whether that index is unique or not, columnstore or B-tree, clustered or nonclustered, etc. But those pieces of information are more hidden away, so there’s a benefit to including them in the name.
The other thing I tried to hit on was apps vs systems Hungarian Notation. The quick version is that systems Hungarian notation specifies the actual data type of a variable, so we might have
iMyValue, where the
i represents 32-bit integer. We might also have
sMyValue for long and short types, respectively. The problem with systems Hungarian notation is that data types change over time, so either you need to rename the variable everywhere (and hope you caught all references in other files, other projects, etc.) or just live with
iMyValue actually being a long now that you broke 2 billion values.
By contrast, apps Hungarian notation delineates uses of data types, so you might have a safe string
sMyString and an unsafe string
usMyString. The difference here is that the “safe” string has gone through regular expression checks, validation mechanisms, etc. and is known to be good. By contrast, an “unsafe” string may have come from a user’s console or an external API call. In this case, we don’t care what the data type is but rather a special characteristic of the variable, something we could not easily infer from IntelliSense or going back to the variable declaration.
The last topic was a quick tip. My team has recently been watching technical videos together. We’re all remote employees so I’ve landed on watchparty.me for these trainings. This is a service which allows you to keep YouTube, et al, videos in sync for several people and also includes chatroom and voice chat functionality. We don’t really use the voice chat functionality at all, sticking to the chatroom instead. It’s a good way of watching a technical lecture together and you generally get more out of it than asking everybody to watch the video beforehand and discussing it.