Elliot Shank via RT wrote:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=38673 >
>
> Jeffrey Thalhammer via RT wrote:
>> Queue: Perl-Critic
>> Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=38673 >
>>
>>> I disagree. MixedCase and CamelCase are indeed two different styles,
>>> and I want neither in my code, so the MixedCase policy is exactly
>>> what I want.
>> Me too. So that's why I was thinking that ProhibitCamelCase +
>> CapitalizationPolicyToBeWritten would effectively default to a total
>> ban on mixed-case symbols (just as we have now). But this would allow
>> folks to address WordSeparation and Capitalization_Strategies issues
>> separately. Which I believe is the main thrust of Schwern's
>> suggestions.
>
> There's nothing ambiguous about "mixed case". It means no lower case
> and upper case characters in the same name.
In the end, the important thing is that I can enforce a word separation policy
(fooBar vs foo_bar) separate from a capitalization policy (foo vs Foo vs FOO)
and that it's clear to the user what each policy is going to do. If the two
concepts are conflated into one policy, that becomes difficult. Ambiguous
name or not.
With that made clear, everyone sensible can stop reading now.
Ok, only the pedants are left. I would not be allowed to keep my membership
in the ILoP [1] if I didn't drive the point into the ground. :) So I decided
to google for "mixed case variable names" and see how it's used: whether
"mixed case" means all letters within a word or just interword-separation
(fooBar).
Below is the first dozen or so uses off Google. As you can see, they all use
some variation of camelCase or sTudLyCaPs for their examples and none refer to
a simple ucfirst "Foo" variable as being mixed case. They're all discussing
capitalization as a means of interword separation. They all use "foo_bar" or
"foobar" as counters. They're all discussing multi-word names. None discuss
the capitalization of single-word names. If whether the first letter should
be capitalized is significant it's explicitly spelled out.
None use "mixed case" to mean just "lower case and upper case characters in
the same name". They all use it to mean "case-switch as an interword
separator". So you're right, there isn't anything ambiguous about "mixed
case". ;)
http://support.sas.com/kb/7/174.html
From webEIS software within AppDev Studio, you could get an error such
as:
ERROR: _GET_UNIQUE_VALUES_ failed. Invalid class list.
Arguments passed to SEND:
1 (Character Literal) = '_get_unique_values_'
Parameters passed to SEND ENTRY:
1 table=TABLE1
2 nextLevel=
Program returning prematurely at line 581
AF Program: SASHELP.RSASMOD.MDAXIS.SCL
https://secure.wikimedia.org/wikipedia/en/wiki/Mixed_case
The systematic use of capitalized and uncapitalized words in running
text is called "mixed case"
http://forum.wordreference.com/showthread.php?t=941391
Make all variable names mixed case. That is, each word or
abbreviation within the variable name should be capitalized.
http://everything2.com/node/1253565
Why do programmers have annoyingly mixed case function names?
ConvertFormatAToFormatB(A, B);
http://everything2.com/node/1253565
And SmallTalk is pretty much the parent of modern object oriented languages.
Presumably mixedCaseNames (as opposed to underscore_separated_names) are
more a forgotten legacy of SmallTalk than some carefully-conceived ergonomic
device.
http://everything2.com/e2node/CamelCase
A special form of mixed-case identifiers widely used mainly in Java circles,
so named because they look like this:
camelCaseIdentifier
The first word of a multi-word identifier is in lower case (the head of the
"camel"), while subsequent words are capitalized (the "humps" of the
"camel").
http://books.google.com/books?id=14CSsIUQ24kC&pg=PA5&lpg=PA5&dq=mixed+case+variable+names&source=web&ots=eVnDz1orqJ&sig=oDLhBgGmpOmGjqdwA1gH-OKTUl0&hl=en&sa=X&oi=book_result&resnum=6&ct=result
The data set name heightweight is the same as HEIGHTWEIGHT or HeightWeight.
Likewise, the variable name BirthDate is the same as BIRTHDATE and
birThDaTe. However, there is one difference for variable names. SAS
remembers the case of the first occurence of each variable name and
uses that case when printing results. That is why, in this book, we use
mixed case for variable names but lowercase for other SAS names.
http://www.velocityreviews.com/forums/t434570-new-coding-standards-use-underscores-hyphens-or-mixed-case-in-command-and-identifier-names.html
Before I embark on a new long-term project I'd appreciate your advice on how
to split up long names. I would like to keep the standards for command names
the same as that for variable names. Looking at the examples below, which
ones seem better?
Straight names
echoclient
lastcharoffset
helloworld
Internal underscores
echo_client
last_char_offset
hello_world
I could also use embedded hyphens as my minus sign must be surrounded by
whitespace (please suspend disbelief while looking at these. I know they
will look unfamiliar!)
echo-client
last-char-offset
hello-world
Mixed case
EchoClient
LastCharOffset
HelloWorld
Initial lower case then mixed
echoClient
lastCharOffset
helloWorld
http://mail.zope.org/pipermail/zope-db/2002-February/000366.html
For example, in Oracle you explicitly have to name your colums in mixed case
for them to be mixed case:
create table "MonKey" (
"wrEnch" varchar2(2),
"l33tSPeaK" number(2,2),
NoMatterWhatCase varchar2(10)
)
http://www.perl.com/doc/manual/html/os2/OS2/REXX/REXX.html
Most REXX DLLs export function names all upper case, but there are a few
which export mixed case names (such as RxExtras)
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
Class names should be nouns, in mixed case with the first letter of each
internal word capitalized.
...
Methods should be verbs, in mixed case with the first letter lowercase, with
the first letter of each internal word capitalized.
...
Except for variables, all instance, class, and class constants are in mixed
case with a lowercase first letter. Internal words start with capital
letters
http://www.adobe.com/devnet/flash/articles/as_bestpractices_02.html
Concatenate words to create names. Use mixed-cases (upper and lower case)
when you concatenate words to distinguish between each word for readability.
For example, select myPelican rather than mypelican.
[1] International League of Pedants, "Accuracy Over Tact".
--
124. Two drink limit does not mean first and last.
-- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army
http://skippyslist.com/list/