|
Posted by Shelly on 11/28/74 11:54
"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?
>
>> (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.
>>> 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".
Shelly
Navigation:
[Reply to this message]
|