CamelCase versus wide_names (Prothon)

Carl Banks imbosol at aerojockey.invalid
Fri Apr 16 00:04:13 EDT 2004


Mark Hahn wrote:
> 
> 
> We have agreed in Prothon that unlike Python we are going to be 100%
> consistant in our var and method naming.  We will not have run-together
> words like iteritems, we are going to always have seperated words like
> has_key.
> 
> Now we are in the midst of a discussion of camelCase versus wide_names.  So
> far our arguments are:
> 
> 1) CamelCase is more elegant, modern, more readable, and more efficient in
> character usage.
> 
> 2) Wide_names is cleaner, more readable, compatible with C, which is the
> standard module language for Python and Prothon.  Wide_names is also the
> Python standard.
> 
> Of course in the Python world you alread have wide_names as your standard,
> but could you for the moment pretend you were picking your standard from
> scratch (as we are doing in the Prothon world) and give your vote for which
> you'd prefer?


Ok, get ready for this one.  When I'm naming classes, instances,
functions, methods, and other complex (not complex number) objects, I
tend to use wide names.  When I'm naming numbers, strings, or
collections thereof, I choose camel case before wide naming.

Why?

Well, I use wide for most objects because I think it's a bit more
readable in general, being closer to what we're used to reading.  (I
guess that might not be the case for Arabic people.)  But, when you
are doing all kinds of math calculations with numbers, or operating on
strings, or whatnot, the underscores make it harder to read, because
it takes effort to sort out whether something's an operator or an
underscore.

In other words, I typically use wide names because they're very
readable and nice looking in ordinary code like this:

    func_status = blast_furnace.ignite_furnace()

but avoid the wide names when they're uber-ugly and unreadable in
operator-laden code like this:

    pitch_rate_coefficient = pitch_rate*mean_aerodynamic_chord/total_airspeed


It would not surprise me if the people who prefer wide names tend to
be applications-type programmers, whereas those who prefer camel case
naming tend to be numerical-type programmers.


-- 
CARL BANKS                      http://www.aerojockey.com/software
"If you believe in yourself, drink your school, stay on drugs, and
don't do milk, you can get work." 
          -- Parody of Mr. T from a Robert Smigel Cartoon



More information about the Python-list mailing list