|
Posted by Wayne on 12/22/05 12:19
On 22 Dec 2005 01:35:31 -0800, tony@marston-home.demon.co.uk wrote:
>On 21 Dec 2005 01:03:48 -0800, t...@marston-home.demon.co.uk wrote:
>
>>> Inconsistency is not a "real" problem as it does not cause the program
>>> to produce wrong results.
>
>> Correct. But I would argue that programs are meant to be read by
>> humans at least as much as by the computer. Humans see a variable
>> called $foo and $foO to be different.
>
>I disagree. I have worked for decades with case-insensitive languages
>and I have always treated $FOO and $foo as the same variable.
But I didn't say $FOO or $Foo. I said $foo and $foO! People have no
trouble will all caps or the first letter capitalized. What about the
difference between setsLower() and setSlower()? To a human reader
those have different meanings, to a case-insensitive compiler they are
the same.
>some like all upper case,
My god. I wouldn't want my code constantly shouting at me. All upper
case is harder to read, too.
>What I object tois being told that I MUST use one case or the other just to be
>*consistent* with everyone else, especially when I disagree with their
>reason for choosing one case over the other in the first place.
The majority of programmers disagree with you on this. Consistency
and conventions are preferred when working on a particular project or
platform -- it cuts down on errors and allows one to convey greater
meaning.
>By introducing case-sensitivity you are suddenly saying that $FOO and
>$foo are now different, which goes against the grain of everything that
>I have been taught since my first day at school way back in the last
>century.
A common Java idiom is:
Foo foo = new Foo();
The convention in Java is that class names begin with an upper-case
letter and variables begin with a lowercase variable. I can clearly
see what is happening here.
To get the same meaning if it was case-insensitive, you'd have to do
something like:
FooClass fooInstance = new FooClass()
Which makes readability worse, not better.
Navigation:
[Reply to this message]
|