Re: [Pyparsing] PEP-8 compliant naming, using synonyms
Brought to you by:
ptmcg
From: Joshua J. K. <jk...@sk...> - 2008-03-07 19:27:38
|
On Fri, 2008-03-07 at 08:34 -0600, Paul McGuire wrote: > A while back, there was a suggestion to adopt PEP-8 compliant names in > pyparsing. For example, oneOf, delimitedList, and quotedString do not > conform to the PEP-8 recommended naming style. According to PEP-8, these > should be one_of, delimited_list, and quoted_string. For this discussion, > I'll call these two naming styles "mixedCase" and "names_with_underscores". > <SNIP> > Any comments? Funny you should bring this up. When I first started reading the docs for pyparsing, one of my first (albeit fleeting) thoughts was, "Hmm, interesting, he doesn't follow PEP-8, the module must have been written in the early days of Python before PEP-8 was well established." I've gone through a lot of naming conventions in my programming experience. mostly_underscores when I did a lot of perl, MixedCase and varHungarianNotation (shudder) when I did VB programming, and even mixed case when I was starting in Python before I read PEP-8. I'm not a fanatic of one style over another, really, and in fact kind of like the look of MixedCase. But I do like consistency, and if there is a "blessed" way of doing things (as I would consider PEP-8 to be) I would tend to lean in that direction. In addition to the reason regarding vision-imparied programmers, I would also add that MixedCase, even if it is capitalizing every word, could still be harder for non-native English speakers to read than words separated by underscores. So, in short, I support the aliasing, and possibly the eventual replacement, with PEP-8 compliant names. Implementation idea: rename all the functions to PEP-8 compliant names, and make wrappers using the old names. Then the wrappers would print out 'suchAndSuch deprecated, use such_and_such instead. Something else to thing about: what does PEP-8 say about keyword arguments? Like I said, I don't really prefer one over the other, but I do like consistency. j -- Joshua Kugler VOC/SigNet Provider (aka Web App Programmer) S&K Aerospace Alaska |