Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
T-SQL (SS2K5)
»
lowercase keywords and usability
25 posts, Page 1 of 3
1
2
3
»
»»
lowercase keywords and usability
Rate Topic
Display Mode
Topic Options
Author
Message
opc.three
opc.three
Posted Monday, July 06, 2009 11:44 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:26 AM
Points: 6,737,
Visits: 11,791
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
Believe you can and you're halfway there.
--Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler
--Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
--Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples.
--Giordy
Post #748315
Lynn Pettis
Lynn Pettis
Posted Tuesday, July 07, 2009 12:04 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 8:07 PM
Points: 21,633,
Visits: 27,491
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
Jack Corbett
Jack Corbett
Posted Tuesday, July 07, 2009 8:15 AM
SSChampion
Group: General Forum Members
Last Login: Friday, May 17, 2013 12:22 PM
Points: 10,571,
Visits: 11,871
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
opc.three
opc.three
Posted Tuesday, July 07, 2009 9:43 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:26 AM
Points: 6,737,
Visits: 11,791
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
Believe you can and you're halfway there.
--Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler
--Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
--Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples.
--Giordy
Post #749005
Lynn Pettis
Lynn Pettis
Posted Tuesday, July 07, 2009 11:38 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 8:07 PM
Points: 21,633,
Visits: 27,491
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
Lynn Pettis
Lynn Pettis
Posted Tuesday, July 07, 2009 11:40 PM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 8:07 PM
Points: 21,633,
Visits: 27,491
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
opc.three
opc.three
Posted Wednesday, July 08, 2009 12:05 AM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 8:26 AM
Points: 6,737,
Visits: 11,791
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
Believe you can and you're halfway there.
--Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler
--Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them.
--Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples.
--Giordy
Post #749049
Lynn Pettis
Lynn Pettis
Posted Wednesday, July 08, 2009 12:16 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 8:07 PM
Points: 21,633,
Visits: 27,491
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
Lynn Pettis
Lynn Pettis
Posted Wednesday, July 08, 2009 12:23 AM
SSC-Insane
Group: General Forum Members
Last Login: Today @ 8:07 PM
Points: 21,633,
Visits: 27,491
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
Ewan Hampson
Ewan Hampson
Posted Wednesday, July 08, 2009 7:29 AM
SSC-Enthusiastic
Group: General Forum Members
Last Login: Yesterday @ 6:43 AM
Points: 140,
Visits: 1,536
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 »
25 posts, Page 1 of 3
1
2
3
»
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.