July 8, 2009 at 3:04 pm
All CAPS for keywoards is how started learning T-SQL.
It is also used in Books-On-Line.
The one advantage I can see is when in-line SQL code is embeded in C# or Delphi, the all-caps SQL statement keywords stand-out.
Out of habit, I will still stick with the original all CAPS. Nothing more serious than personal prefrences based on my history with T-SQL.
July 8, 2009 at 6:36 pm
...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
July 8, 2009 at 6:37 pm
...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
July 8, 2009 at 6:38 pm
Lynn Pettis (7/8/2009)Do you consider anyone with a degree in Computer Science a Computer Scientist?
Unless the university where they earned a degree completely failed them, then yes, any graduate of an accredited Computer Science program should have the knowledge of programming languages necessary to speak to this subject objectively. Anyone interested in this topic beyond the useless "I prefer this because I have been coding for this long so I am an authority on the topic"-banter may have some depth of knowledge and be willing to share that. I am not sure who made you the spokesperson for the folks that visit this forum but you may have insulted a large group of people that actually do take their craft seriously beyond the scope of the business world. It only takes one person to stumble on this post that knows something beyond the banter to provide useful feedback to the question that was originally asked.
I work in the business world as well and I agree with your assertion that business users couldn't care less about what convention the source code we produce happens to follow. However they do care about how fast we can produce said source code and how few defects that code contains. If there is a particular code convention that will help us achieve the business goals faster and better then I want to know what it is so I can implement it. So yes, this question could be dismissed as purely academic, and maybe I will also take this to academia as you suggest, but it actually has a real-world purpose beyond the basic quest for knowledge, namely me earning my bonus quarter after quarter 🙂
Thanks for your comments.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
July 9, 2009 at 10:24 am
Short answer: It really sounds like your answer lies in a different arena that this forum. Possible with the National Science Foundation. They sponsor (aka spend a lot of my money) research into stuff like this. Mainly with university projects.
Long answer:
I spend a lot of time working on different teams and reading other peoples code. Style and syntax does have a great impact on readibility -> understanding which is necessary for error-free integration and maintenance of large systems. Anytime we read (anything) we engage in a process of information gathering. We live in a world with 5 senses so that things like a fire can be smelt, before it is seen. Similarly reading code is a multi-sense process. The compiler/interpreter does not care it is a finite state machine, but I have to infer intent and other information from fuzzy-logic professionals. Case, color, indent-style, etc all can be used to convey to me a programs multi-layered and complex structure. In consistencies lead to errors that run the gamut from (case sensitivity combined with auto variable definition) bugs to more complex (that's what it says, but that's not how I use it) logic errors.
Personally, it would be interesting to know what is the best, but that is a lot like any top ten list. It's always relative to the audience. For most business issues there are always at least 2. The group doing the work and the group paying for it. Because each group has a different definition for 'best' (programmers - fast, readable, etc; client - error free, low cost), the answer to best will never be a singular one.
As everyone who has been in the industry for even a few years knows, coding language syntax has been all over the map and there is no consistency (for example UNIX case sensitive vs DOS not). I have been involved in some language definition projects in the past and I never recall a discussion of case syntax/usability EVER.
Also in today's world, most 'reputable professionals' are required to being multi-platform and multi-language literate. Thus compounding the consistency conundrum. As a programming/design consultant I work for a number of companies and need to constantly adopt to internal conventions. (YUK, language differences are hard enough).
Of course, in the end, assuming the 'best' could be quantitatively defined, getting the 'industry giants' to agree to use it will occur right AFTER the proverbial 'world peace' is achieved.
Given the above reality and some of your replies to people's "this is what I like" posts , I assume the thrust of your question is more theoretical than practical. I would try NSF.
Signing off with ...
Real_World.Life.Reality(_workingForALiving)
or would it be
me.Life.Real_world = new Reality(_workingForALiving)
(for for you human readers)...
Now back to the REALITY of the Real_World (aka _workingForALiving)
July 9, 2009 at 2:11 pm
Forum Newbie(7/9/2009)
I have been involved in some language definition projects in the past...
Thank you for the post...do you mind telling more about these projects? What types of analysis went into them? Do you have any of the notes on the formation of the definitions and what types of elements were considered? What problem domains were they intended for? Were they derivatives that mimicked the syntax and conventions, and therefore usablity, of existing languages? I have seen where domain-specific query languages often do this and end up looking a lot like SQL. Thanks again for the post.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
October 5, 2010 at 6:19 pm
If you do want a tool for simple keyword capitalisation, try this one:
October 6, 2010 at 3:44 am
i suspect that research on layout of code for productivity gains is hard to do because of the number of 'variables'.
e.g. (1) the likely reasons for reading the code (initial writing, later maintenance, looking for a specific issue/section of code, trying to get an overview of the processing)
(2) type of code - short table views vs long stored procedures
(3) other layout issues - how the code is indented, what code is placed on a single line and what is wrapped, whether the code is being viewed in b&w or with colour distinguishing keyword, object names, comments etc
as an attempt at objectivity (but not based on any research) -
- the point made about books being mostly in lower case with capitalisation to highlight the start of sentences and some other key words seems to imply that generally lower case is easier to read than upper case so any standard that results in a lot of upper case is not so good
- possibly two different issues affect productivity - (a) the ability to find required pieces of code quickly and (b) being able to understand what the code is doing. both these issues are more affected by overall layout of the code and associated commenting than by any capitalisation used
- the use of colour and layout is more powerful than the capitalisation (IMO) - i have macros to add the colour to SQL and VB code when putting it in word documents because it makes it so much easier to read. the macros also tend to standardise the capitalisation of keywords but i chose to do this more for aesthetic reasons that productivity but i think that having the code in a standard form that i am used to seeing does help productivity
this is veering towards personal preference from objectivity so i'll stop there
ANDY
--------------------------------------------------------------
“Doubt is not a pleasant condition, but certainty is absurd.” Voltaire
October 6, 2010 at 7:44 am
I think some of it comes down to: Is SQL code readability covered by the general text readability type study?
Personally, I think not, and that it's going to be affected by personal preferences, as it involves formatting, and color distinctions, etc. I am sure some of the general text readability study would apply though.
I know I have my preferences, but can be flexible, as I don't get to determine the standards at every job I work.
October 7, 2010 at 6:29 am
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
With all due respect, this aspect of your co-worker's point is nonsense: if my productivity were limited by my typing speed, I'd be a very happy DBA. I'd attend a secretarial typing course and double my coding output in one 6-week period!
Rich
Viewing 10 posts - 16 through 24 (of 24 total)
You must be logged in to reply to this topic. Login to reply