SQLServerCentral Editorial

We'll go no more a' tibbling

,

I have to admit that I've never liked Hungarian notation in database work. I've often heard it called 'tibbling' in development groups, after the horrible habit of prefixing table names with the lowercase tbl (table without the vowels). So you end up with tables called tblCustomer, tblInvoice, tblSales and so on. The same started happening with indexes (idxName and so on), and stored procedures, so that everything became spThisAndThat. This made conversation about data issues rather difficult as it was never clear how to say the word tblCustomer or tvfMyFunction.

Hungarian Notation was originally developed by Charles Simonyi, who went on to become a chief architect at Microsoft, as a quick fix to the errors that came from programming in BCPL, a very loosely typed language. It caught on so well that it became a part of object-oriented orthodoxy, particularly at Microsoft. In SQL, where it wasn't necessary, we Database developers managed to stay aloof from the practice of tibbling until we started to get Microsoft Access applications being 'migrated' into SQL Server. The developers, who used Hungarian notation for their Visual Basic, naturally had done the same for the database objects and the names were perpetuated when the migration occurred: Because of this, and because a generation of programmers have been brought up with the idea that Hungarian notation is the way to do it, SQL Server is now hopelessly infected with the practice.

Hungarian notation isn't necessary in any compiler that does strong type-checking. SQL can occasionally produce errors where implicit conversion of data types happens, but these errors are too subtle to be caught by tibbling. Another problem is that, where a column's datatype is changed, then the name of the column has to be changed. Anyone who has done this, and has fallen foul of dynamic SQL and the problems of finding and renaming all the instances of the column, or other objects, due to the vagueness of the dependency checker, will want to avoid too much of this.

However, my biggest objection to Hungarian notation is that it gives a false sense of security. Even if you are a strict adherent, and use Hungarian notation to tell you the object type, and maybe the datatype, it doesn't tell you the purpose, or intended use, of the object. No; as the old folk song goes "We'll go no more a tibbling, though whitsuntide is nigh"

Rate

5 (3)

You rated this post out of 5. Change rating

Share

Share

Rate

5 (3)

You rated this post out of 5. Change rating