Good programming style

Grant Edwards grante at visi.com
Mon Sep 15 00:30:32 EDT 2008


On 2008-09-15, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
> Adelle Hartley <adelle at akemi.com.au> writes:
>
>> I'm looking at porting a library that was written for COM and .Net
>> to work as a Python module, and was wondering whether it would be
>> better to stick to the library's current naming convention so that
>> the API is as similar as possible on each platform, or to adopt a
>> "when in Rome..." policy and follow the "most mainstream" naming
>> pattern for each platform/language.
>
> I think it's more important for Python library APIs to comply
> with the Python coding guidelines (as specified in PEP 8) than
> to comply with standards in other languages.

I think the practical matter of being able to use existing
documentation and examples might be more important than
maintinging the purity of PEP 8 naming styles.

> The Python library you're implementing isn't being used in
> those other languages, so the conventions of other languages
> have little relevance.
>
> It's being used in Python code, so it should mesh well with
> PEP 8 compliant code ??? by having the API itself comply with
> PEP 8.

I think that battle was lost long ago, but maybe that just
because I use a lot of libraries written in C, C++, and Fortan
and then wrapped with things like swing.

-- 
Grant







More information about the Python-list mailing list