I went back and forth, both ways.
I started out in Python with snake_case identifiers, then moved to Javascript with camelCase, and now I mostly use Rust with snake_case for names and UpperCamelCase for types.
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.
I mostly find the readability the same, except for acronyms in the middle. RemoteHTTPIPAddr vs remote_http_ip_addr. I prefer the latter, but my go-to language these days encourages the former.
I work in telecoms where there are so many acronyms that snakeCase is really painful (but we still use it).
As for your second example, why not remote_HTTP_IP_addr ?
Even more readable IMHO.
My current style convention mixes several naming styles to help in distinguishing code visually.
I 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.
What language is that in? Conventions tend to follow with programming languages.
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.
15 comments
[ 2.8 ms ] story [ 43.8 ms ] threadI 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%...
I 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.