Uppercase vs. lowercase for keywords

  • It just occurred to me there is an argument for upper case keywords giving better performance. Perhaps the query parser takes note of the queries that are "shouting" and puts them through a little more quickly?

  • Actually, that is a myth, however, the closer the keyword is to the start of the line (fewer indents/spaces), the sooner it will get executed by the processor.  The same is true for commas (separating columns) at the end of the line vs. start of next line.  Tabs take extra effort because the server has to query the client and find out where its tab setting is at.  And in that same vein, an undocumented feature of SQL Server that I use all the time is the key word "PLEASE" which will give priority to your threads & processes.  (e.g. CREATE PROC get_list PLEASE AS...), also the "WHERE APPROPRIATE" clause of the select statment and the sp_domyjob procedure in the master database was generously provided by MS...

     

     

     

  • Through out all this no one has wondered why "Intellisense" can take care of color coding but not capitalization.

    What about some settings to implement the "shop standard" for caps, indents, etc.

    Next would be the option to do what I want when I tell you. Such as shouting "Get me a bunch of records that meet my parameters." from the bathroom while getting your but wiped (automatically of course).

    BTW, john-132685, the correct use is WITH PLEASE. Works like a charm.

    Thought control coming next, who need a keyboard!

    Al Kessler
    It's too bad that
    Common Sense Isn't

  • al_kessler (5/8/2012)


    Through out all this no one has wondered why "Intellisense" can take care of color coding but not capitalization.

    What about some settings to implement the "shop standard" for caps, indents, etc.

    Next would be the option to do what I want when I tell you. Such as shouting "Get me a bunch of records that meet my parameters." from the bathroom while getting your but wiped (automatically of course).

    BTW, john-132685, the correct use is WITH PLEASE. Works like a charm.

    Thought control coming next, who need a keyboard!

    LOL not sure if you noticed but this is an 8 year old thread and john hasn't logged in here for 6 years. 😀

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • And besides all that, upper case letters take more ink. Pretty soon your screen is bound to run out of it. Then where will you be?

    Seriously, legibility is the issue but legibility is not just a function of u/lcase, it is also a function of the DIFFERENCE between something that you want to emphasize and all else that surrounds it.

    As color came onto the scene it represented one more way to make something look different from its surroundings (and made it easy to spot errors like missing closing quotes. Even these days when color is available on almost all the monitors in a workplace, it is not so available on all the printers in that workplace.

    U/lcase is sort of a weird one. If you look at a lot of code where all the keywords are in lower case, upper case looks strange and unnecessary. But if you look at a lot of code where all the keywords are in upper case, it seems harder to differentiate lower case keywords from the data.

    I've been in environments where common tags and terms that everyone knows are usually written in lower case, but those tags and terms that you don't see from day to day are usually written in upper case.

    <td style="text-align: left;" WRAP class="myClass">

    Chuck Hoffman
    ------------
    I'm not sure why we're here, but I am sure that while
    we're here we're supposed to help each other
    ------------

  • P.S. I've been writing code of one kind or another since 1965, and I missed the closing parenthesis in my post, above, truly by accident. Color might have saved me from that.

    Chuck Hoffman
    ------------
    I'm not sure why we're here, but I am sure that while
    we're here we're supposed to help each other
    ------------

  • Mom always said I was special! Found this while looking for other info on Uppercese and couldn't help tagging on. Noticed afterward how old it is. Never expected to see a reply. I guess the thing to strive for is consistany in format. Some settings in the Intellisens to impleement the house standard format would help! I try to stay consistant but usually fail, get depressed, and consider trying one of those beer popsicles I heard about somewher on this site.

    Al Kessler
    It's too bad that
    Common Sense Isn't

  • I learned this at SQL Saturday in Madison last week: http://poorsql.com/

    "Poor SQL: Take pity on your SQL with instant, free and open-source, online formatting using the Poor Man's T-SQL Formatter library."

    Paste your code and it indents, capitalizes keywords and color codes. :w00t:

Viewing 8 posts - 16 through 22 (of 22 total)

You must be logged in to reply to this topic. Login to reply