0

# Which style is best? [closed]

I've seen,

myvariablename = "String"


I've seen,

MyVariableName = "String"


I've seen,

myVariableName = "String"


I've seen,

my_variable_name = "String"


I know these all work the same but which one is best?

### Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

2
KarlXYZ 120
7 years ago

I wouldn't say there is a "best" way to format your variables. I guess it's just down to personal preference.

I'll tend to use myVariableName (First word is lower-case, rest are upper-case).

0

I use MyVariableName. It does not really matter, use the one you like.

0
TheMyrco 375
7 years ago

Very technically speaking, the one with the most lowercase letters and the least amount of charcters would be the best.

But really .. that's so, so, so small that it's neglegible. It really comes down to personal preferences, as said by the others.