EyeTracking Study: camelCase vs. under_score style (2010) [pdf]
cs.kent.edu
cs.kent.edu
my $is-it-time = True;
The hyphen is allowed inside an identifier as long as it is not the first and as long as it is followed by at least one letter. my $foo-42; # interpreted as my $foo - 42I prefer camelCase for variables, which need to be typed repeatedly, and camel is fastest to type. I use snake_case for functions, UpperCamelCase for classes/types, and ALL_CAPS_SNAKE for configuration variables a user would be expected to edit.
In C, snake case is historically the default, but I tend to use UpperCamelCase for functions, UpperCamelCase for file-level static variables, lowerCamelCase for function-level static variables and ALL_CAPS_SNAKE for #defines.
camel is fastest to type
iAgree but englishIsAlso fasterToType byRemovingSpacesAnd capitalizingFewerWordsThan usual. iDonT knowWhy weProgrammers shouldConsiderThat aWorthwhile tradeOffI did it for years in Perl then moved to camel with Java. Now, I sort of like not having to type underscores.
I don't find either style better than the other, the only time I notice anything is when I switch between style conventions (e.g. switch between JS and Rust or C++), because I need to break the habit of typing one way rather than the other.
Still, I find readability of the two styles pretty much identical at all times once you get used to both.
RemoteHttpIpAddr
https://google.github.io/styleguide/javaguide.html#s5.3-came...
https://docs.microsoft.com/en-us/previous-versions/ms182249%...