![]() | |
#11
| |||
| |||
|
|
jcelko212 (AT) earthlink (DOT) net (--CELKO--) writes: Uppercase the reserved words This is one I've never quite understood. I tend to go with lower case, |
#12
| |||
| |||
|
|
I tend to go lower case with keywords, and upper case with database names. |
|
.. I find that my eye is attracted to the database names in code when they |
#13
| |||
| |||
|
|
I tend to go lower case with keywords, and upper case with database names. I got into that habit back in the 80s when I was using DEC Rdb/VMS. I started with FORTRAN, so everything was uppercase on punch cards. Then I went over to C and evevrything was lowercase. Again this is due to physical reasons. Punch cards and old line printers did not have lowercase. Teletypes were a bitch to use and the original C and UNIX people were two-finger typists who did not like to hold a shift key. |
#14
| |||||
| |||||
|
|
Readers see the UPPERCASE word as a unit in itself rather than actually read it. Think about a STOP sign in lowercase; it does not work fast enough. |
|
The only keywords I would expect to scan for while debugging are SELECT, FROM and WHILE [WHERE], but those are all along the left margin, so capitalizing them isn't useful. You have no subqueries? No predicates AND-ed together? |
|
Experienced programmers do not read code like test (left to right, top to bottom); they read it in chunks, usually clauses or subclauses in modern languages. Example: 1) where color in ('blue', 'green') and name like 'J*' 2) WHERE color IN ('blue', 'green') AND name LIKE 'J*'; The second example has a keyword at the beginning of each chunk. |
|
[Do not indent more than 3 spaces] I find the eight-character tab for the AND line quite clear Did you notice that you uppercased AND, to make your sentence readable ? |
|
Eye movement. The average English word is five letters, so we expect to see a word in a longer gap. The 8-space tab is a mechanical accident from the first teletypes that got carried over; see also the 80-column screen from the 80-column punchcard. The tab indentation was a real maintenance killer when we had crappy printers and 132 column green-bar paper; alignment was awful, so we had to use a special ruler to follow code. |
#15
| |||
| |||
|
|
I still get a kick out of MS telling us how they discovered the internet, are really interested in it, etc. and then invent a language called C# so that the octothrope will mess up stuff on the web. |
#16
| |||
| |||
|
|
jcelko212 (AT) earthlink (DOT) net (--CELKO--) writes: |
|
Eye movement. The average English word is five letters, so we expect to see a word in a longer gap. The 8-space tab is a mechanical accident from the first teletypes that got carried over; see also the 80-column screen from the 80-column punchcard. The tab indentation was a real maintenance killer when we had crappy printers and 132 column green-bar paper; alignment was awful, so we had to use a special ruler to follow code. I don't understand what problem you encountered that would have been solved by 3-character tabs. Was it that the lines got longer than 132 columns because of all the tabbing and wrapped around? |
|
I'm not trying to be argumentative in all this. I'm pushing and prodding to make sure that whatever standard I put forth is defensible. |
#17
| ||||||||
| ||||||||
|
|
Upper case makes a word stand out as a unit in itself. This is certainly desirable in a STOP sign, but not in keywords that, in my |
|
I do have subqueries. In these, SELECT, etc. are the leftmost non-whitespace words. Same with AND. It's indented, but still |
|
The main difference between the two is dropping a line and indenting. Changing it all to lower case would do nothing, except to |
|
Normal people read sentences IN chunks IF you simply go WITH normal capitalization. |
|
I absolutely did notice. The reason I uppercased AND was to make it clear that it was a unit in and of itself, not a conjunction |
|
In SQL I use it as a conjunction, relating surrounding clauses to each other. I want people to read it as they normally do, so why use |
|
I don't understand what problem you encountered that would have been solved by 3-character tabs. Was it that the lines got longer |
|
I'm not trying to be argumentative in all this. I'm pushing and prodding to make sure that whatever standard I put forth is |
#18
| |||
| |||
|
| IAmSeekingCitationsForStudiesThatEitherConfirmOrRe futeMy PersonalOpinionThatUnderscoresAreMoreReadableThanC amelCase. I_am_seeking_citations_for_studies_that_either_con firm_or_refute_my personal_opinion_that_underscores_are_more_readabl e_than_CamelCase. |
![]() |
| Thread Tools | |
| Display Modes | |
| |