J
James Harris
Before I embark on a new long-term project I'd appreciate your advice on how to split up
long names. I would like to keep the standards for command names the same as that for
variable names. Looking at the examples below, which ones seem better?
Straight names
echoclient
lastcharoffset
helloworld
Internal underscores
echo_client
last_char_offset
hello_world
I could also use embedded hyphens as my minus sign must be surrounded by whitespace
(please suspend disbelief while looking at these. I know they will look unfamiliar!)
echo-client
last-char-offset
hello-world
Mixed case
EchoClient
LastCharOffset
HelloWorld
Initial lower case then mixed
echoClient
lastCharOffset
helloWorld
In some ways I like the mixed case versions using an inital capital, especially as I may
want to prefix some names with a code for an abstract data type, which, when present,
could begin with a lower case. Is this getting too Microsoft-ish? Is it getting to
Hungarian? Is Hungarian bad when used with abstract data types rather than inbuilt ones?
Advice on which is or is not thought to be acceptable would be much appreciated. Please
bear in mind that I intend these names for commands/instructions as well as variables and
types. Constants would be in all caps.
long names. I would like to keep the standards for command names the same as that for
variable names. Looking at the examples below, which ones seem better?
Straight names
echoclient
lastcharoffset
helloworld
Internal underscores
echo_client
last_char_offset
hello_world
I could also use embedded hyphens as my minus sign must be surrounded by whitespace
(please suspend disbelief while looking at these. I know they will look unfamiliar!)
echo-client
last-char-offset
hello-world
Mixed case
EchoClient
LastCharOffset
HelloWorld
Initial lower case then mixed
echoClient
lastCharOffset
helloWorld
In some ways I like the mixed case versions using an inital capital, especially as I may
want to prefix some names with a code for an abstract data type, which, when present,
could begin with a lower case. Is this getting too Microsoft-ish? Is it getting to
Hungarian? Is Hungarian bad when used with abstract data types rather than inbuilt ones?
Advice on which is or is not thought to be acceptable would be much appreciated. Please
bear in mind that I intend these names for commands/instructions as well as variables and
types. Constants would be in all caps.