Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

A Simple Mistake Expand / Collapse
Author
Message
Posted Friday, May 9, 2008 6:43 PM
SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,039, Visits: 1
Comments posted to this topic are about the item A Simple Mistake
Post #498304
Posted Saturday, May 10, 2008 5:31 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 11:08 AM
Points: 577, Visits: 2,502
A simple test of the daftness of the idea that case sensitivity in computer languages is a good idea is to read out a C# program that uses case to distinguish private and public fields. It can't be done without inventing a way of distinguishing case in speech. Perhaps we should read out lower case letters in a high voice and capitals in a high voice. One could, I suppose shout out upper case but then reading out fortran code snippets would lead to sore throats. How then does one read out such Javascript functions as getElementById() to distinguish it from the completely different function getElementByID? The only way to do this would be to have a language sound, maybe by making a little click with your tongue as they do in parts of Africa, to denote a Shift (as with an old-fashioned typewriter).

This issue has been going on for thirty years, and in all that time I've never heard a rational argument for making computer languages case-sensitive, yet I can see that, in a few years time, they will all be case-sensitive; even SQL.



Best wishes,

Phil Factor
Simple Talk
Post #498340
Posted Saturday, May 10, 2008 7:32 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 23, 2008 4:12 AM
Points: 1, Visits: 7
Well, I started as a C# and JavaScript programmer and then exposed myself to T-Sql. I considered the fact that sql is case-insensitive a design mistake :).
When I had to write SSIS tasks in VB.Net I struggled heavily with that alien case-insensitive environment. I grew up in a case sensitive world. It seems to be all a matter of perspective.
Post #498356
Posted Saturday, May 10, 2008 8:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 1, 2009 7:37 PM
Points: 2, Visits: 29
Phil,

I too have been programming for more years than I care to admit, but I was at Brooklyn College beta testing UNIX when Kernighan and Ritchie were writing it at Bell Labs. In all my years, I too have never heard a rational argument for case-sensitivity being syntactically enforced. The only benefit that I can see for upper and lower case is stylistic. It does make reading variables easier, similar to the underscore, and for that I agree it makes sense.

If we could calculate the number of hours collectively spent debugging code over the years because of case-sensitivity issues, it would be hard to justify its continued usage.
Post #498366
Posted Saturday, May 10, 2008 10:47 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 12, 2008 1:42 PM
Points: 6, Visits: 29
Case sensitivity increases the expressiveness of the language by making it possible to add semantic content merely by changing letter case. By adopting, understanding and applying consistent standards, programmers are able to take advantage of this feature to write code that is more clearly understood, increasing the maintainability of the systems for which the code is written. For example, a C# programmer using the popular, common and consistent naming standards will recognize the different between these two identifiers: AddressValidator and addressValidator. The first is a class name, and the second is a variable name that references an instance of the former.

Lack of case sensitivity is a factor in what I consider one of the worst sins upon maintainability and understandability that we have seen in the last 20 years -- the use of names such as btnOK, vldAddress, and so on. Modern development environments with their syntax coloring and "IntelliSense" features have such stellar support for distinguishing between the use of different symbols that I dismiss summarily arguments that case sensitivity leads to errors of the type indicated in the article. While that may have been true in the days when K&R were first introducing C, it is a shallow and hollow argument today.

I would argue that those who oppose case-sensitivity in programming languages lack the observational sensitivity to see coding errors introduced by case, and instead of blaming their own shortcomings, choose to transfer blame to an environment that does not make up for their weaknesses in this area. Some people are just not cut out for such sensitivity in their observations, and you can't blame them, just like you can't blame the color blind for their lack of color distinction. It is not a moral or intellectual shortcoming.

To remove the expressiveness enabled by case sensitivity because some people can't deal with the consequences makes as little sense as restricting handguns from responsible, law-abiding adults because irresponsible criminals acquire the tools and use them for harm. If you can't deal with the tool - case sensitivity - you should not use it, but you shouldn't force others to forgo its use because of that.
Post #498384
Posted Saturday, May 10, 2008 11:08 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, November 10, 2008 9:26 PM
Points: 1, Visits: 27
Perhaps it's because my roots go back further in this than Microsoft involvement in rhe database server market, but when I read the article, I thought it was a little turned around. Column naming conventions were case sensitive when the product originated as Sybase SQL Server many years ago, as it was with any other data. Much of that philosophy came from the older Unix world where they came from, when MS wasn't really interested in Servers yet, and the Unix vendors looked down their noses at the idea of desktops. On case sensitivity, it's really an example of things coming full circle rather than any kind of revolution.
Post #498386
Posted Saturday, May 10, 2008 11:46 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Yesterday @ 11:08 AM
Points: 577, Visits: 2,502
As I understand it, Standard SQL converts identifiers to upper case internally unless they are delimited. IBM, Postgres, Sybase and Oracle follow this rule. What this effectively means that as long as you avoid delimited identifiers then there is no problem.

The problem comes when you have delimited identifiers and you get the case wrong. The SQL Standards say that "MyTableID" and "MyTableId" are different. This is fine, as the errors will tell you of slip-ups, until some clever person wants to 'increase the expressiveness of the language by making it possible to add semantic content merely by changing letter case' by defining both a "MyTableID" and "MyTableId" somewhere. Then, there is chaos.

SQL Server can get things wrong if you choose a case sensitive collation, because it doesn't follow the standard SQL convention: suddenly undelimited identifiers are compared in a case-sensitive way. I'd suggest putting a trap in your code to make sure that IDENTIFIER_CASE hasn't been inadvertently set to SENSITIVE. Dead simple, create two identifiers MyTableID and MyTableId If no error then IDENTIFIER_CASE = SENSITIVE!

I mention javascript because we have getElementById and encodeURIComponent. I can accept that I'm not clever enough to join the ranks of the observationally sensitive who are able to remember that an ID is camelCased to Id whereas a URI is kept in capitals, but then programming languages were originally designed to be easily understood. -oh yes tbut that is probably a shallow and hollow argument today.



Best wishes,

Phil Factor
Simple Talk
Post #498391
Posted Saturday, May 10, 2008 12:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, December 12, 2008 1:42 PM
Points: 6, Visits: 29
Phil Factor,

Being able to easily spot the difference between getElementById() from getElementByID() while skimming through code is not a matter of being clever. In fact, I expressly stated that I do not think that it is a matter of being clever, smart or "good" at all. Some people just don't pick up or care about subtle differences in typed language, and my personal observations indicate that these same people have equal disinterest in correct spelling and punctuation of human languages. But regardless of their aptitudes in perceiving deviations from spelling and punctuation standards used by the people to and for whom they write, there is absolutely no reason to think that the semantic content of their communication is any less valuable or full because of it.

My point is not to insult anyone as being less capable or intelligent in a general sense, but to point out that the flexibility afforded by case sensitivity is valuable and useful to a large number of people, and should not be taken away just because some other people find it inconvenient. To echo your comparison with certain African languages that use clicks, if you have difficulty understanding the language because of that feature, the solution isn't to ask the speakers to use English.

Of course, abuse of the flexibility afforded by case sensitivity could lead to chaos. The same could be true of enabling people to name things using more than two letters. Any system is potentially abused, and will be. I agree wholeheartedly that "The problem comes when you ... get the case wrong.." This is precisely why we (a) have standards and (b) don't go off and do something that violates them. I'll build upon my analogy as well: just because you have a handgun doesn't give you a right to shoot somebody with it; if you have trouble keeping yourself from shooting at people and property, you should be held accountable from the problems you cause with the gun; in the latter case, you probably should not be allowed near a gun to begin with.

The "MyTableID" vs. "MyTableid" argument strikes me as a strawman supported by a lot of "ifs", "untils" and slippery slopes. Here is my own set of "ifs", "untils": if you approach all coding as if it were impacted by case sensitivity, and use a consistent set of standards, you will not have to worry about case sensitivity. However, until you approach coding with standards that include letter-case, you will be subject to the sorts of issues you mention, such as someone changing willy-nilly the collation.

Sincerely,
Troy
Post #498396
Posted Saturday, May 10, 2008 1:24 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:06 PM
Points: 7,116, Visits: 14,990
troyehall (5/10/2008)

To remove the expressiveness enabled by case sensitivity because some people can't deal with the consequences makes as little sense as restricting handguns from responsible, law-abiding adults because irresponsible criminals acquire the tools and use them for harm. If you can't deal with the tool - case sensitivity - you should not use it, but you shouldn't force others to forgo its use because of that.


I'm not going to get into the "who's more astute/smarter/dumber/observationally motivated/whatever" argument as it only leads to flames, religious wars, etc... I do however think that BOTH sides of the argument have some value, but that both camps are wrong in trying to force their viewpoint on the world.

In fact I can't believe that it would be so very difficult to set up case sensitivity as a compiler option, that could then be picked on a project by project basis. I do think it was a design mistake ultimately to make that a sine qua non in C and all of its derivative. Just like you can now specify various levels of XHTML standards to follow (each with their own rules, including those about case), there's no real justification in my mind that c# or C++ should cram case-sensitivity in code down your throat while VB and its ilks don't give you the option to enforce it if you should wish to do so.

In other words - there should be an option.


----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #498400
Posted Saturday, May 10, 2008 1:41 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, June 1, 2009 7:37 PM
Points: 2, Visits: 29
Mr. Hall,

whew, can we say anger management. If your intent was not to insult with your comments, you failed miserably. In fact, what is interesting is that your tirade was actually in agreement with the people you were yelling at. Your argument throughout was that case sensitivity provides clarity, or what I called style, which does not produce a syntax error. If that is not the case, then I think you need to rethink your argument. Capitalization in language does not changer meaning, which was Phil's and my point. It changes style or emphasis. Select means select whether it is spelled "SELECT" or "sElEcT".

Take you argument about the bntOK object. I can see no circumstances where it would be advantageous to create objects okBTN, oKBtn, OkBTN, adnauseum. If anything is implies a degree of mean spiritedness and elitism and creates havoc with anyone trying to work on your code. So as I said before, using upper/lower case for clarity(style) is fine but the compiler should ignore it and not produce a syntax error.

If you want to force standards, than all you need to work on are text editors that force the output to be styled correctly regardless of the case.

I would also like to remind you that civility and respect are essential to purposeful discourse. As a scientist, I learned a long time ago, disagreement is fine, in fact, welcomed in debate. But intellectual honesty is what determines outcome, not how loud you shout or beat down your opponent.



Post #498401
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse