I have a class named SSLXMLRPCServer. Should it be that or SslXmlRpcServer?
views:
121answers:
7If my python class name has an acronym, should I keep it upper case, or only the first letter?
I normally uppercase acronyms. Twisted and a few other libraries do this as well.
This is a matter of personal preference, but I find the second format much easier to read. The fact that your first format has a typo in it (PRC instead or RPC) suggests that I am not the only one.
The PEP-8 mentions nothing about acronyms. You would be safest to keep the acronyms uppercased (it's what I see most).
I had this problemlots of time . I uppercase Acronym but I doesn't like it because when you chain them (as in your example) it doesn't feel right. However I think the best things to do is to make a choice and stick to hit, so at least don't you know when you need to reference something how it's written without having to check (which is one of the benefit of coding standard)
The problem with uppercase acronyms in CamelCase names is that the word following the acronym looks like a part of it, since it begins with a capital letter. Also, when you have several in a row as in your example, it is not clear where each begins. For this reason, I would probably use your second choice.
It should be SSLXMLRPCServer, to match the standard library classes like SimpleXMLRPCServer, CGIXMLRPCRequestHandler, etc.
Adopting a naming convention that differs from equivalents in the standard library is only going to confuse people.
How about SSL_XML_RPC_Server
for acronymity and readability?
It's what I often do when I want to avoid camel-case for some reason.