oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #01549
Naming Conventions : mixedCase vs. lower_case_with_underscores
Hi all !
I'd like put on discussion the topic related to the coding name
conventions used on the all project, specially the naming styles
applied on the function and method names,variables, method arguments
and instance variables used on the OSHIP.
At the moment, the mixedCase[1] the most predominant naming style. In
the other hand, the PEP8[2] encourage the lower case with underscores
as a way to improve readability. The mixedCase is publicly known to be
used by Zope community[3] for a few years. The mixedCase conventions
are mostly found on the Java codes. Java developers use this naming as
the unique naming style for the language. A python developer community
have freedom to choose which naming style looks like your style.
I personally prefer the lower case with underscores because it break
the signature on separated words on giving me a good read impression
that it looks like simpler than the other options. Simplicity counts
for me. :)
As you can notice, this topic is a personal opinion. Anyway it is
important to be discussed here, define a clear definition which path
seens to be more appropriate to the OSHIP. Here are some advantages
and disadvantages that I think acceptable to put on a trade-off
situation. Feel free to include more opinions if it's not covered on
the next points:
"mixedCase"
PROS
- It is vastly used on Java,C# and C++ community. Zope community also uses it.
- It a well known naming style shared by different languages which
surround the object orientation paradigm.
- Its easier to type than "lowercase with underscores". You don't
have to move your fingers to any corner at the keyboard to type the
underscore character.
CONS
- Put the words together into a large stream of characters can confuse
at first, because they can represent a unique word.
"lowercase with underscores"
PROS
-It's known by the all python community. If a new member that have a
little background on the language, it will feel comfortable to use the
convention.
-Usually it is used by languages which follows the functional paradigm.
-It improves readability, because it separates the
method/variable/function signature on words. So, it forces the
developer to read each part of the signature carefully, giving a
chance to the reader understand quickly what the code definition is
about.
-The openehr specifications describe methods using this naming style
on class methods . Using it on a OSHIP code won't create a gap between
the conventions when different conventions are used on the concept and
implementation domain.
-It gives a simplicity sensation.
CONS
-It's boring type the same underscore character every word separation. :)
[1] - http://www.iwombat.com/standards/JavaStyleGuide.html#Method%20Names
[2] - http://www.python.org/dev/peps/pep-0008/
[3] - http://wiki.zope.org/zope3/ZopePythonNamingConventions
Follow ups