CamelCase versus wide_names (Prothon)

Michael Geary Mike at DeleteThis.Geary.com
Fri Apr 16 02:45:42 EDT 2004


> Mark Hahn wrote:
> > 1) CamelCase is more elegant, modern, more readable, and more efficient
in
> > character usage.

Paul Rubin wrote:
> IfCamelCaseWereReallyMoreReadable, We'dWriteOrdinaryEnglishLikeUsingIt.
> SoThatClaimIsRidiculousAndNeedsToBeThrownOutTheWindowPostHaste.

> > 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.

> Sounds_ok_with_me.
I_find_it_a_heck_of_a_lot_more_readable_than_camel_case.
> I_vote_for_wide_names.

If we were writing English sentences and for some reason were forced to
write an entire sentence as a single word in one of these two styles, then I
would be persuaded by your examples.

But, we're not writing English, and we're not writing an entire sentence as
a single word.

We are writing program code where we compose a single name out of multiple
words. That name is combined with several other names in a statement or
expression with much more punctuation than you'd use in English prose.

To me, names_with_underscores are easy to read in isolation. But when they
are combined with multiple other names_with_underscores and a lot of
punctuation, the result for me is visually confusing. I have a hard time
seeing where one name ends and another one begins. Underscore is a
punctuation mark too.

But since you're using English to make the point, let's run with it a bit.
However, instead of contrived examples that no one would ever write, we'll
use a real English paragraph with real names:

I edit my Python code with SlickEdit and ActiveState Komodo. I use an IBM
ThinkPad, largely because I like its TrackPoint pointing device. I enjoy
taking pictures with my Canon PowerShot camera, and I use a PreSonus
BlueTube preamp when I play harmonica. Today I drove by OfficeMax, and I saw
ads for the DoubleTree hotel and Lufthansa's PrivateBeds and FlyNet.

What if I wrote this instead:

I edit my Python code with Slick_edit and Active_state Komodo. I use an IBM
Think_pad, largely because I like its Track_point pointing device. I enjoy
taking pictures with my Canon Power_shot camera, and I use a Pre_sonus
Blue_tube preamp when I play harmonica. Today I drove by Office_max, and I
saw ads for the Double_tree hotel and Lufthansa's Private_beds and Fly_net.

Is that easier to read?

-Mike





More information about the Python-list mailing list