|
Posted by Oli Filth on 12/23/05 15:31
Chung Leong said the following on 23/12/2005 03:27:
> Oli Filth wrote:
>
>>I think the issue of case sensitivity/insensitivity is one where
>>everyone just has to agree to disagree. It's one of those issues that
>>everyone prefers what they're used to, and there's no fundamental
>>arguments either way, just like for indent style.
>
>
> Agreeing to disagree isn't a terribly good solution here, as it's a
> zero-sum game.
Much in the same way as it is for indentation style. In this case, there
are differences, but the arguments presented aren't very convincing
either way. It's not an argument that anyone's going to win, is it? So
it's almost a waste of time even talking about it.
(However, I will say that PHP as it stands is a bit retarded, having
case-sensitive variable names, but case-insensitive function names. How
does that help anyone??)
> Case-sensitivity let you use identical tokens spelled in different
> cases to refer to different things. I don't think I have heard a single
> argument in favor of this practice, aside from an "oh, the Java folks
> are doing it." Capitalization is a device usually used for emphasis and
> conveying emotion. It's a poor choice for as a signifier, as it's not
> easy to see in print and cannot be communicated at all vocally.
Although I just said arguing about it is pointless, I will interject
here anyway!
Kimmo made a good point elsewhere that capitalisation is used all the
time in maths equations. A lot of what I do is maths-based, and base my
code variable names on the variable names in the equation,
capitalisation and all. e.g. if the maths is:
N
F[k] = Sum (f[n].g[k])
n=1
i.e. the sum from 1 to N of f[n].g[k], I'll do:
for (int n = 1; n <= N; ++n)
{
F[k] += f[n] * g[k];
}
i.e. using both n and N (and f and F) to refer to different things. If
one knows the maths that the code is implementing (if one didn't, then
there'd be no point trying to read/debug/maintain the code), then one
would know exactly what these variables meant.
--
Oli
Navigation:
[Reply to this message]
|