|
Posted by Tony Marston on 11/13/26 11:54
"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
news:Cd-dne2roPe8tFLZnZ2dnUVZ_qudnZ2d@comcast.com...
> Tony Marston wrote:
>> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>> news:PO-dnZ9kL4xhvFPZnZ2dnUVZ_vKdnZ2d@comcast.com...
>>
>>>Tony Marston wrote:
<snip>
>> Case sensitivity can lead to unmaintainable code. For example, if there
>> is a variable called $foo I expect $Foo and $FOO to mean the same thing,
>> not different things. The fact that they are not can lead to unexpected
>> results. Programmers who deliberately create different variables with the
>> same name but different case are bad programmers, but a *proper* language
>> (such as COBOL) removes the possibility for such bad programming by
>> ignoring case and treating all the variables as a single variable. Any
>> language which deliberately allows programmers to wrte unmaintainable
>> code is a bad language. After all, that is why most modern languages do
>> not include GOTO because f the problems it can cause.
>>
>
>
> Yes, I can see where having $foo, $Foo and $FOO be the same thing could be
> very confusing. I would never code something like that, and it would lead
> to terribly unmaintainable code in a case-insensitive language. I don't
> know why anyone would ever want to do that.
Having $foo, $Foo and $FOO which mean the same thing in a case-insensitive
language does NOT lead to unmaintable code as much as it does in a case
sensitive language which makes them separate things. I say his because I
have worked for 25+ years with case insensitive languages and seen different
case used on different projects, and it has never been a problem.
> Fortunately, in a case-sensitive language such as PHP, C, Java and many
> others, that's not a problem. It makes those languages much more
> maintainable.
I disagree. Having $foo, $Foo and $FOO mean different things causes more
problems than it solves, as does haing different functions called
readfile(), readFile() and ReadFile(). Nobody in their right minds would
deliebrately write such obfuscated code, therefore the language should
protect the programmer from making such a stupid mistake by being
insensitive to case. Afetr all, most languages deliberetel do not incude the
GOTO verb for that very same reason.
> It's a good thing modern languages have gone beyond the arbitrary
> restrictions of older languages like COBOL and FORTRAN.
Since when does being insenstive to case become an arbitrary restriction?
> And I wouldn't say a language which allows programmers to write
> unmaintainable code is a bad language.
Then why do most languages not allow the unstructured GOTO? Surely for
clever programmers who need such a verb, the fact that it is not allowed is
much more of a restriction than case insensitivity?
> You can write unmaintainable code in any language - I've seen some
> terrible COBOL code, for instance, which was designed to be easy enough
> for even a non-programmer to understand. And I've seen some code which is
> easy to maintain in assembler (which is much harder to do than any other
> language).
>
> Rather, good programmers can create maintainable code in any language,
> while poor programmers create unmaintainable code in any language.
Wow! You've actually said something with which I agree. I'll make a note of
that in my diary.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Navigation:
[Reply to this message]
|