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

Posted by Tony Marston on 12/17/10 11:55

"Shelly" <sheldonlg.news@asap-consult.com> wrote in message
news:G29Ag.8943$157.3466@newsread3.news.pas.earthlink.net...
>
> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
> news:eaq2lp$7jc$2$8300dec7@news.demon.co.uk...
>>
>> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
>> news:7BGzg.6578$gF6.716@newsread2.news.pas.earthlink.net...
>>>
>>> "Tony Marston" <tony@NOSPAM.demon.co.uk> wrote in message
>>> news:ean53d$rlk$1$8300dec7@news.demon.co.uk...
>>>> 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.
>>>
>>> You just said it here right now. It can lead to unexpected results
>>> ....for YOU....because ...YOU...expect them to be the same when, in
>>> fact, they are different thingsp
>>
>> And so does everybody else with a background in case insensitive
>> languages.
>
> Be careful with your use of terms. I challenge the use of "everybody".
> My background was in Fortran and then PL/1 from 1963 until I got into C in
> **1988**. When you see a better way........
>
>>
>>>> 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
>>>
>>> IMO COBOL is the worst language I have ever seen. I have not programmed
>>> in that language for almost thirty years. At that time it treated all
>>> variables as globals -- talk about you UNMAINTAINABLE code!!!!
>>
>> It is possible to write mantainable code in COBOL just as it is possibe
>> to write unmaintable code in Java. It is the programer and not the
>> language which is the deciding factor.
>
> Absolutely! However, the inability to pass to local variables in a
> subroutine/paragraph/method/whatever is the worst possible deficiency in a
> programming language -- much worse than the hated goto. Such was COBOL.
> The error rate goes up exponentially in those languages with the size of
> the code because of this one factor alone. **THAT** is unmaintainable
> code. BTW, as I have not touched COBOL in over 25 years, can you now have
> local variables?

As I haven't used COBOL in a very long time I wouldn't know.

>>> (I think they changed that somehow, but am not sure). If you happened
>>> to use the same name in two different (were the "subroutines" called
>>> paragraphs or procedures? -- I forget), then a change in one changed the
>>> value in the other -- and that was not convention; it was the language
>>> itself. Ugh and double-ugh!!!
>>
>> That is not the case as I remember it. Each subprogram has its own
>> working storage section, so anything declared in one subprogram cannot
>> possibly affect anything in another subprogram. It is only when you get
>> to shared storage areas, such as common storage or the linkage section,
>> that you may have problems. Yet agin, as COBOL is a compiled language,
>> anything which is actually declared more than once can be flagged as an
>> error at compile time, so the problem is easily spotted and fixed.
>
> Sorry, but it WAS the case.

Not in my memory. You could declare a working storage item name in one
subprogram and exactly the same working storage item name in aother
subprogram and they would NOT conflict. That is because the working storage
area in any subprogram is entirely local to that subprogram.

>>>> deliberately allows programmers to wrte unmaintainable code is a bad
>>>
>>> Oh, I'll totally agree with that statement. That is why COBOL (at least
>>> circa 1975) royally sucked wind.
>>
>> I agree. COBOL 85 was much, much better.
>>
>>>> language. After all, that is why most modern languages do not include
>>>> GOTO because f the problems it can cause.
>>>
>>> Uh, in fact that is not correct. Java, C, C++ and any other I can think
>>> of all allow the goto. It is just that good programmers don't use it.
>>> What do we call that now? I think the word "convention" comes to mind.
>>
>> Programmer conventions are still not the same as language rules, and I
>> dislike the idea of certain conventions in some languages being promoted
>> to rules in other languages.
>
> You are entitled to your opinion. What I see, though, is that when a
> programmer convention is seen to hold tremendous value in one language, it
> becomes prudent and realistic to try to then enforce a similar convention
> as a rule in another language. It is called "learn from others and take
> what works best".

But a programmer convention in one language may only have been introduced
because of a deficiency in that language. There is no point in enforcing the
same convention on another language if that language does not suffer from
the same deficiency.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

 

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

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