On Sun, Jan 2, 2011 at 9:52 AM, Alan Gauld <alan.ga...@btinternet.com>wrote:
> "Corey Richardson" <kb1...@aim.com> wrote > > On Sat, Jan 1, 2011 at 9:10 PM, Alan Gauld <alan.ga...@btinternet.com> >>> wrote: >>> >>>> Why avoidCamelCase? I actually prefer it to using_non_camel_case >>>> >>> >>> Python appears to use camelCase more than not. >>> >>> >> I tend to disagree with that. In the stdlib, as well as the builtins, >> many, many methods are alllowercase, for example str.isdigit() or >> socket.gethostname(). >> > > Which should, according to PEP8, be get_hostname()(*) and > is_digit()... > > The stdlib is a mess of inconsistency. I assume that's why PEP8 > seems to get more attention these days - it's been around for ages. > Some modules use CamelCase, some use underscores and > some just use long lowercase names (the worst option! - well > apart from all uppercase like COBOL...!) > Well, PEP8 does suggest that the preference is 1) lowercase names unless readability suffers, such as in goallist or something that can be improved, then 2) goal_list is preferred over goalList, unless 3) existing code uses theOtherWay. Personally I feel lowercase_with_underscores to be more readable than lowercaseWithoutUnderscores, although since I took that (required) Java class my junior year, I'm used to typingIncrediblyLongNamesThatAreRidiculouslyVerboseTellingYouEverythingThatTheClassOrFunctionMayOrMayNotDo, in that style of case. I am firmly convinced that Java is the reason IDEs with really good auto complete were developed ;) I try to code according to PEP8, and write all my functions/variables using onlylowercase except when_i_cant_tell_what_that_word_is. And of course I try to make my variables as short as possible, but no shorter :) -lowercasefully, wayne_werner > > (*)hostname could be host_name I guess but Unix tradition > spells it as one word so I've followed that convention... > > Alan G > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor