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 123»»»

lowercase keywords and usability Expand / Collapse
Author
Message
Posted Monday, July 6, 2009 11:44 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:51 PM
Points: 7,140, Visits: 12,763
Does anyone know of any usability studies or reference articles having to do with keyword capitalization and naming conventions in T-SQL? I was told by a former colleague that all lowercase with underscores for word separators (for example select column_name from dbo.table_name) were superior in terms of readability and ease of typing. The idea was that the average typist could type more code per minute using lowercase and underscore formatting than when using Pascal or Camel case for user-defined entities and that all lowercase keywords were somehow more readable and easier on the eye. This colleague never produced any of the supporting articles that he cited during our conversation so I left it at that point. That said, he was convincing however he has since moved on and Google has failed to uncover any articles on the subject despite my best efforts. Can anyone that can provide supporting reference documentation provide input on this topic? I am not looking for a religious or philosophical discussion here, no unsupported opinions please, zealots stay away...thanks for reading

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #748315
Posted Tuesday, July 7, 2009 12:04 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 20,861, Visits: 32,889
I'm not a zealot, and i don't have any supporting documentation. What I will tell you is that you will get a lot of differing opinions on the matter.

I personally like case-sensitive collations, type key words in lower case, hate underscores and spaces in column names and table names, and use Pascal casing for names.

Now that I have had my say, I'm sure others will be along and post their thoughts as well.

Bottom line, it depends on what you prefer and the standards in place where you work. Sometimes you have to change to meet the standards where you work.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #748320
Posted Tuesday, July 7, 2009 8:15 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:26 AM
Points: 10,381, Visits: 13,436
I'm not a zealot either, but I prefer all lowercase with underscores instead of Pascal or CamelCase for object names, although I do like uppercase key words.

I don't like case sensitive collations, but by using all lowercase and underscores I can handle case sensitive collations when it comes to object names.

The main thing to me is that an organization have a standard and everyone sticks to it. My current project someone else created the database objects and used Mixed_Case with underscores. I can't stand it, but when I create tables or columns I use that standard. Because I did the stored procedure development stored procedures are in all lowercase with underscores so we have slightly mixed standard.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #748568
Posted Tuesday, July 7, 2009 9:43 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:51 PM
Points: 7,140, Visits: 12,763
With all due respect all the quasi-objective opinions and conjecture have been stated (and restated, and restated) at this point...does anyone know of any objective case studies (no pun intended) or research articles they can relay?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #749005
Posted Tuesday, July 7, 2009 11:38 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 20,861, Visits: 32,889
No. It all comes down to company standards and/or personal preference.

As a former co-worker once stated, Standards are great and every one has one.

If SQL Server required all UPPER CASE keywords, then I would use them, as would every one else. SQL doesn't care, regardless of collation how the keywords are typed. It only cares abut case with regard to object names when the collation is case sensitive, as then A <> a.

Even when using a case-insensitive collation, I chose to type object names in the appropriate case. You will always see my code using all lower case characters when referencing system objects, such as sys.objects. If a case insensitive database has a object name such as dbo.ThisIsMyTable, that is exactly how I will type it even though dbo.thisismytable and dbo.THISISMYTABLE would also work. That is my preference. I just find it easier to read.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #749041
Posted Tuesday, July 7, 2009 11:40 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 20,861, Visits: 32,889
It should be noted, iirc, that if you want to write code that will port directly to Oracle, all object names need to be created and typed in UPPER CASE. And that you will most likely use (_) underscores to separate words in object names to make them more readable. So you also have that to worry about. Of course, I'm not writing code like that as I work in a Microsoft centric shop.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #749042
Posted Wednesday, July 8, 2009 12:05 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 8:51 PM
Points: 7,140, Visits: 12,763
I see this not as a SQL Server or Oracle problem, but as a human one. I am looking for evidence that supports that an approach to capitalization can make for more readable code and therefore make humans more productive in an environment that favors a particular approach over another. Something not based on opinion or preference and certainly not what a software company decided to implement. For instance there are areas of linguistics dedicated to how a languages can shape thought based solely on how the language is constructed. The written word is studied extensively, but I am not finding much in the way of research done on source code and how the format of it can impact productivity. Why aren't books printed in all caps? Can source code be compare to books? I have seen claims that the human brain can more easily consume words in all caps when those words are meant to be interpreted as symbols, and that claim inferred that keywords in a programming language could qualify as symbols making all caps the best way to go. I have also seen it stated that words in all lowercase are more easily read and digested by the human brain given that words in all caps tend to disrupt the eye and thought process rather than to allow the brain to read and understand the words naturally as it would any other printed text...see where I am going with this? Just looking for someone that knows of some science that has been applied to this topic.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #749049
Posted Wednesday, July 8, 2009 12:16 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 20,861, Visits: 32,889
Most people on this site are practitioners not scientists. Not really sure you will find what you are looking for here.

Simple question for you though, would you read a 600 page book written in all capital letters? I wouldn't. Mixed case as appropriate is easier to read. Also, look at a post or email written in all caps, it feels like you are being yelled out.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #749054
Posted Wednesday, July 8, 2009 12:23 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 2:01 PM
Points: 20,861, Visits: 32,889
Also, I can read code fine wether it is written in all lower case, all upper case, or mixed case. What I really want from some one writing code is consistancy. If you are writing all your keywords in all UPPER CASE, be sure all your keywords are in all UPPER CASE. If object names are mix cased, keep them mixed case through out the code. If system objects are in all lower case, please keep them in all lower case. Especially on a forum site like this, you never know what collation some one may be using on their system. You really should write your code in that case as if it might be run on a case sensitive system. At work, we run PeopleSoft which uses the Latin1_General_BIN collation (case sensitive) we also run an SIS system which uses a case insensitive collation. Don't change how you write things through out your code, that is what makes reading code more difficult.


Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #749059
Posted Wednesday, July 8, 2009 7:29 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, December 12, 2014 2:04 AM
Points: 142, Visits: 1,735
Lynn Pettis (7/8/2009)
Simple question for you though, would you read a 600 page book written in all capital letters? I wouldn't. Mixed case as appropriate is easier to read. Also, look at a post or email written in all caps, it feels like you are being yelled out.

As you reference in your next post, a lot of that is convention. If books were always in upper case we would probably be comfortable with that. Would you be comfortable reading a book with every noun capitalised? Well I wouldn't, but isn't that how German does it? The OP (or, indeed, opc) may find academic research in the wider field of written language.

I have SQL2K5 with no fancy tools: if Intellisense (I gather it is in SQL2K8) or any of the Third Party add-ons default to a particular casing-style, that could become the standard simply because we all start using them. But the point about Oracle is significant: if SQL is meant to be a cross-database standard, in the absence of rules perhaps we ought to adopt conventions that make us write SQL that is more portable. (Then if only we could do something to force those Access [aaaah!] users to define sensible names for those objects they want moving to SQL Server...)
Post #749241
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse