You are here: Re: Case sensitivity in programming languages. « PHP Programming Language « IT news, forums, messages
Re: Case sensitivity in programming languages.

Posted by Jerry Stuckle on 12/17/63 11:54

Tony Marston wrote:
> "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.
>

Using different case to mean the same thing throughout your code is
completely moronic. I learned that even when I was doing
case-insensitive languages such as FORTRAN and PL/I. Anyone who did
that was considered to be either a noob or a piss-poor programmer.

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

But they are completely different things.

As for your function names - often times readfile() will be a global
function, while readFile() would be a member of a class. Most
programmers I know wouldn't use ReadFile().
>
>> 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?
>

It means you can't have readfile() and readFile().
>
>>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?
>

Actually, most languages DO allow unstructured GOTO. It's just not used
much in structured languages. There are much better ways of doing it.

For instance - I don't know how many LOC I've written in C and C++ -
both of which have the goto statement. Other than maybe when I was just
learning, I have never used it. Never found a need for it.

But then according to your theory, C, C++, FORTRAN and even your beloved
COBOL are bad languages because they all allow GOTO in one form or another.

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


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация