Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: camelCase vs snake_case

by talexb (Canon)
on Aug 29, 2012 at 18:35 UTC ( #990528=note: print w/replies, xml ) Need Help??


in reply to camelCase vs snake_case

My preference when it comes to writing code is readability. What that really means is readability to me. Everyone has a different ideal on how to make code readable.

To me, a variable name like $camelCase is very readable. The sigil is full height, and that's followed by a lower case letter. After that, each word within the variable name starts with a capital letter. It's also easy to type: just upper and lower case letters. That's the typography angle for you.

A variable name like $camel_case is not as friendly from a typing point of view -- I have to stop typing letters and go and hit the underbar. This gets worse if it's $a_really_long_variable_name; I never learned to type properly, so my typing style probably contributes to this.

Worse than this is the choice that combines camelCase with snake_case .. $a_Very_Long_Variable_Name. If you're able to type that easily and quickly, good for you -- I'll never use it.

Finally, I've met Damian a few times when he's visited Toronto -- he's a very entertaining speaker and is extremely knowledgeable about Perl and Computer Science. Still, I don't agree with *everything* he says -- in some cases I have my own preferences.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990528]
help
Chatterbox?
[james28909]: upon trying various solutions, i was forgetting to package up the script into an executable
[marto]: that'll do it
[james28909]: im glad im not in charge of anything important, like filling up peanut butter jars
marto grins

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-07-28 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (431 votes). Check out past polls.