Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: camelCase vs snake_case

by greengaroo (Hermit)
on Aug 29, 2012 at 18:36 UTC ( #990529=note: print w/ replies, xml ) Need Help??


in reply to camelCase vs snake_case

Funny enough, I changed ways of doing things several times during my career. I remember that I use to make most of my variables CamelCase in the beginning. After reading stuff and meeting other developers and seeing other people's code, I gradually changed.

So now, for variables, I don't use uppercase because Perl itself uses it for internal variables, such as @ARGV or %ENV. You never know, maybe you can stumble on a pre-defined variable by mistake! So CamelCase or snake_case? Well I choose snake_case because in my experience, I often had errors from mistyping one of the letters, for example: $staticAlert instead of $StaticAlert. I think snake_case is easier to read too. I use the same rule for methods or subroutine names.

For modules, I use CamelCase. I don't like modules in lowercase or snake_case because when you have something like this: My::NameSpace::something_to_do, how can you know at first glance if something_to_do is another module or a subroutine of NameSpace? So I stick to CamelCase for modules and that works well for me.

There are no stupid questions, but there are a lot of inquisitive idiots.


Comment on Re: camelCase vs snake_case
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://990529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (16)
As of 2015-07-07 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls