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/72 11:54

Tony Marston wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
> news:PO-dnZ9kL4xhvFPZnZ2dnUVZ_vKdnZ2d@comcast.com...
>
>>Tony Marston wrote:
>>
>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>news:Fs6dnZzOr4BKU1HZnZ2dnUVZ_vydnZ2d@comcast.com...
>>>
>>>
>>>>Tony Marston wrote:
>>>>
>>>>
>>>>>"Jerry Stuckle" <jstucklex@attglobal.net> wrote in message
>>>>>news:-o2dnUSBY-LaCFbZnZ2dnUVZ_sudnZ2d@comcast.com...
>>>>>
>>>>>
>>>>>
>>>>>>Gertjan Klein wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Shelly wrote:
>>>>>>>
>>>>>>>[Snip a lot of comments I don't disagree with]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>If Java were not case sensitive would it still work? Yes. Is it
>>>>>>>>essential to the language? No. Does it bring benefits? Absolutely.
>>>>>>>
>>>>>>>
>>>>>>>No, it does not. What you have described are conventions used in the
>>>>>>>case of symbols to make their "type" (constant, variable, function,
>>>>>>>whatever) clear. These conventions are useful for languages that have
>>>>>>>no
>>>>>>>other means to distinguish between these types. I've seen nobody
>>>>>>>disputing their usefulness. (Note that you can make a THISTHING that
>>>>>>>is
>>>>>>>not a constant, and a thisThing that is not a variable. The only
>>>>>>>meaning
>>>>>>>of the case used is in the programmer's mind.)
>>>>>>>
>>>>>>>The problem with case sensitive languages is that thisThing and
>>>>>>>THISTHING are entirely different. That means they can both exist at
>>>>>>>the
>>>>>>>same time. This can lead to problems in the hands of sloppy or c00l
>>>>>>>programmers. I see no benefit in having two "things" with the exact
>>>>>>>same
>>>>>>>name, differing only in case, meaning two entirely different things.
>>>>>>>
>>>>>>>Gertjan.
>>>>>>
>>>>>>Gee, a and b can exist at the same time, as can x and y.
>>>>>>
>>>>>>thisThing and THISTHING are two different variable names - and can
>>>>>>exist at the same time.
>>>>>>
>>>>>>And yes, it's a problem to sloppy programmers.
>>>>>>
>>>>>>And there are definite benefits. For instance, "Customer" can be a
>>>>>>class, while "customer" an object of that class. And CUSTOMER is a
>>>>>>defined value. Three different identifiers meaning three different
>>>>>>things.
>>>>>>
>>>>>>But if you're never worked on a multi-programmer project in a case
>>>>>>sensitive language you may not understand the benefits.
>>>>>
>>>>>
>>>>>I have worked for 25+ years with case INsensiive languages, and I cannot
>>>>>see any advantages, only problems.
>>>>>
>>>>
>>>>
>>>>And I have worked almost 40 years in case INsensitive languages, and
>>>>almost 25 years in case SEnsitive languages. I see a definite advantage,
>>>>and fewer problems.
>>>
>>>
>>>Can you identify any problem where case sensitivity is the only solution?
>>>Are you not aware of the problems which case sensitivty can cause?
>>>
>>
>>No, because you have never identified any problems caused by case
>>sensitivity - despite many people asking you about them.
>
>
> 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.

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. It's a good thing modern languages have gone beyond the
arbitrary restrictions of older languages like COBOL and FORTRAN.

And I wouldn't say a language which allows programmers to write
unmaintainable code is a bad language. 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.

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

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