Re:CamelCase vs. underscores: Scientific showdown
by illcollins on Tuesday March 03, 2015 @11:38AM
(#9138599)
Agreed, although python convention is for underscores also.
According to pep8 "Function names should be lowercase, with words separated by underscores as necessary to improve readability. mixedCase is allowed only in contexts where that's already the prevailing style"
Re:CamelCase vs. underscores: Scientific showdown
by rowanseymour on Tuesday March 03, 2015 @11:46AM
(#9138681)
PEP8 also says "Class names should normally use the CapWords convention."
Re:CamelCase vs. underscores: Scientific showdown
by ttmarek on Tuesday March 03, 2015 @11:55AM
(#9138757)
PEP8 also says "The naming conventions of Python's library are a bit of a mess, so we'll never get this completely consistent -- nevertheless, here are the currently recommended naming standards. New modules and packages (including third party frameworks) should be written to these standards, but where an existing library has a different style, internal consistency is preferred."
> Camel case is easier to type, and underscores are hard to type.
I'll grant it that, but in the context of programming, this does not seem to be a "pro". After all, don't we spend far more time reading code than we do writing code?
I'm old, but I'm still surprised at how I have to fight over my reluctance to do something in another language (such as Python) when I remember that it's conventionally camelCase...on the other hand, I try to use it as a personal advantage...I can immediately tell in a body of code what helper functions originated from me, as I'll habitually write them in underscore (though this probably annoys the shit out of anyone who then tries to read/use my code).
Conversely, my enthusiasm for using R jumped when I read Hadley Wickham's style guide and saw that he endorsed underscores (http://r-pkgs.had.co.nz/style.html)