A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

The use of underscore characters in field naming conventions



 
 
Thread Tools Display Modes
  #1  
Old June 28th, 2005, 11:12 PM
CAD Fiend
external usenet poster
 
Posts: n/a
Default The use of underscore characters in field naming conventions

Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What about
for table names and such? Does the same practice apply?

TIA.

Phil.

  #2  
Old June 28th, 2005, 11:35 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

There's really no right answer: naming conventions are just that,
conventions. (other than no spaces: few, if any, argue that spaces are
okay!)

I personally prefer "camel case": using CapitalLetterToSeparateWords.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"CAD Fiend" wrote in message
...
Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What about
for table names and such? Does the same practice apply?

TIA.

Phil.



  #3  
Old June 29th, 2005, 12:07 AM
CAD Fiend
external usenet poster
 
Posts: n/a
Default

Gotcha. But one thing about camel case is that you can't use the CTRL Left
Arrow or Right Arrow on the keyboard when all of the text is together like
that.

"Douglas J. Steele" wrote:

There's really no right answer: naming conventions are just that,
conventions. (other than no spaces: few, if any, argue that spaces are
okay!)

I personally prefer "camel case": using CapitalLetterToSeparateWords.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"CAD Fiend" wrote in message
...
Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What about
for table names and such? Does the same practice apply?

TIA.

Phil.


  #4  
Old June 29th, 2005, 01:31 AM
John Vinson
external usenet poster
 
Posts: n/a
Default

On Tue, 28 Jun 2005 15:12:28 -0700, CAD Fiend
wrote:

Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What about
for table names and such? Does the same practice apply?

TIA.

Phil.


Underscores are pretty much acceptable: Access, SQL/Server, Oracle,
MySQL all accept them in field_names. Blanks are *allowed* in Access
but cause real headaches in these other dbms's (they are allowed, by
quoting the names, but they're still a hassle). CamelCaseCapitals (or
Camel_Case_Capitals if you prefer) make for easier reading, but
remember that table and fieldnames are not case sensitive so there is
no distinction between names which differ OnLy iN CapiTalIZation.

John W. Vinson[MVP]
  #5  
Old June 29th, 2005, 02:06 AM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default

Can't use Ctrl-Left Arrow or Ctrl-Right Arrow to do what?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"CAD Fiend" wrote in message
...
Gotcha. But one thing about camel case is that you can't use the CTRL
Left
Arrow or Right Arrow on the keyboard when all of the text is together like
that.

"Douglas J. Steele" wrote:

There's really no right answer: naming conventions are just that,
conventions. (other than no spaces: few, if any, argue that spaces are
okay!)

I personally prefer "camel case": using CapitalLetterToSeparateWords.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"CAD Fiend" wrote in message
...
Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What
about
for table names and such? Does the same practice apply?

TIA.

Phil.




  #6  
Old June 29th, 2005, 02:49 AM
RuralGuy
external usenet poster
 
Posts: n/a
Default

"Douglas J. Steele" wrote:

Can't use Ctrl-Left Arrow or Ctrl-Right Arrow to do what?


Word Left and Word Right! Old WordStar commands are hard to kill!

--
RuralGuy

Please reply to the newsgroup so all may benefit.
  #7  
Old June 29th, 2005, 09:46 AM
Brendan Reynolds
external usenet poster
 
Posts: n/a
Default

Ctrl+Left and Ctrl+Right don't work with underscores in the VBA editor
either (though they do in SQL view). And for most people, the underscore is
a seldom-used (or at least 'less frequently used') character, and will slow
down typing. So there are pros and cons, for and against. As others have
said, there's really no clear-cut right or wrong here.

I'm currently reading a book on coding guidelines for .NET, and one of the
recommendations the authors make is that you shouldn't use underscores in
names of public properties or methods, but it's OK to use them in private
properties or methods. In other words, if you're the only person who will
ever have to type those names, it's just a matter of personal preference.
But if you're exposing those names to others it is better to avoid
underscores. I'm inclined to agree with that.

--
Brendan Reynolds (MVP)


"CAD Fiend" wrote in message
...
Gotcha. But one thing about camel case is that you can't use the CTRL
Left
Arrow or Right Arrow on the keyboard when all of the text is together like
that.

"Douglas J. Steele" wrote:

There's really no right answer: naming conventions are just that,
conventions. (other than no spaces: few, if any, argue that spaces are
okay!)

I personally prefer "camel case": using CapitalLetterToSeparateWords.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"CAD Fiend" wrote in message
...
Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What
about
for table names and such? Does the same practice apply?

TIA.

Phil.




  #8  
Old June 29th, 2005, 04:54 PM
CAD Fiend
external usenet poster
 
Posts: n/a
Default

Sorry, Doug. I meant "can't use CRTL-Left Arrow to navigate over whole words
instead of one character at a time".

"Douglas J. Steele" wrote:

Can't use Ctrl-Left Arrow or Ctrl-Right Arrow to do what?

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"CAD Fiend" wrote in message
...
Gotcha. But one thing about camel case is that you can't use the CTRL
Left
Arrow or Right Arrow on the keyboard when all of the text is together like
that.

"Douglas J. Steele" wrote:

There's really no right answer: naming conventions are just that,
conventions. (other than no spaces: few, if any, argue that spaces are
okay!)

I personally prefer "camel case": using CapitalLetterToSeparateWords.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"CAD Fiend" wrote in message
...
Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What
about
for table names and such? Does the same practice apply?

TIA.

Phil.



  #9  
Old June 29th, 2005, 04:55 PM
CAD Fiend
external usenet poster
 
Posts: n/a
Default

That's right! But actually that's been a thing with me since WP I
think! But it works with any MS app as well.

RuralGuy wrote:

"Douglas J. Steele" wrote:

Can't use Ctrl-Left Arrow or Ctrl-Right Arrow to do what?


Word Left and Word Right! Old WordStar commands are hard to kill!

--
RuralGuy

Please reply to the newsgroup so all may benefit.


  #10  
Old June 29th, 2005, 04:58 PM
CAD Fiend
external usenet poster
 
Posts: n/a
Default

John Vinson wrote:

On Tue, 28 Jun 2005 15:12:28 -0700, CAD Fiend
wrote:

Hello,

What is the proper naming convention for naming fields? Some people
will use underscores between the key words, some just use caps. I
believe that you also should not us spaces. Is that correct? What about
for table names and such? Does the same practice apply?

TIA.

Phil.


Underscores are pretty much acceptable: Access, SQL/Server, Oracle,
MySQL all accept them in field_names. Blanks are *allowed* in Access
but cause real headaches in these other dbms's (they are allowed, by
quoting the names, but they're still a hassle). CamelCaseCapitals (or
Camel_Case_Capitals if you prefer) make for easier reading


I happen to only disagree with this one point, John. I find the underscores
make it easier to read the field names, but that's just me.

, but
remember that table and fieldnames are not case sensitive so there is
no distinction between names which differ OnLy iN CapiTalIZation.

John W. Vinson[MVP]


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form, Subform, Tab key 2nd_Stage_User Using Forms 17 August 25th, 2006 12:30 AM
How to hide leading characters in field within report esupplystore Setting Up & Running Reports 3 May 13th, 2005 09:05 PM
Follow up Question – Convert one field into three fields Doug General Discussion 2 April 9th, 2005 10:21 PM
Count Characters in a field Donna I-don't-know-VBA-fully-yet Using Forms 1 August 13th, 2004 10:52 PM
NUMBERING the pages Bob New Users 7 June 14th, 2004 12:20 AM


All times are GMT +1. The time now is 02:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.