TSQL and the Tower of Babel

It is always a bit of a strain to program in several languages at once. A simple task like writing a database-driven website will involve you in at least three, maybe more. The experience of diving into JavaScript, VB.NET, and TSQL, all at once, is one that most human brains aren’t, in evolutionary terms, designed for.

Every year or so, someone gets the brainwave of developing a universal language which gets around the awfulness of having to learn, and use, so many. Either these people do not know the history of IT (PL/1 is a good starting point), or they think that ‘this time it will be different’. It never is.

There are alternative approaches to this. By far the worst is to make languages ‘converge’ so that, for example, a comment block, Switch statement, or ‘for loop’ is the same in all languages. As languages get more similar, the brain gets more confused. All those little clues that remind the dozing consciousness what language he’s in are taken away, and one starts making mistakes. VB and C# are converging noticeably. There is even a joke going around VB programmers that the way to convert code from C# is to comment out the semicolons. It is getting to be almost true.

An alternative strategy is to make languages diverge strongly enough that it is obvious, and that one can mentally switch from one to another without conscious effort. I never had a moments problem, in times past, in switching from C to assembler, to SQL. I’m happy with switching between JavaScript and TSQL. On the other hand, switching between JScript, JavaScript and Java can make the head spin.

SQL Server is now its own ‘Tower of Babel’. It is noticeable that TSQL has been added to by Microsoft programmers with a variety of sympathies. The original Sybase variety had a reasonable consistency, but this has been compromised by interference from the procedural and object-oriented cultures that followed. Additions to SQL Server all seem to reflect the prevailing technological culture of the time. Now, when we are faced with XPath and SQL in the same environment, it is all starting to look a bit messy.

There probably is a process, or decision process, within Microsoft for ensuring the consistency of the syntax of TSQL, as it develops in SQL Server, but wouldn’t it be a wonderful thing to make it into an open standard so we can all use a restraining hand when the Microsoft Hotshots start dreaming up more extensions to the language in a variety of syntax conventions?

What are your views on how TSQL (and SQL Server in general) has evolved over recent years? Has it become bloated and confusing, or simply more powerful (or both)? And what’s the solution? Just add your comments to my blog, and all entries will go into a prize draw to win a Simple-Talk gift bag!