Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Tue Jul 20, 2021 5:06 pm

ejolson wrote:
Tue Jul 20, 2021 3:52 pm
I'll add that many students who need help with calculus are actually having trouble with arithmetic.
Are you saying kids arrive at university with no skills in arithmetic or calculus?

If so, what the heck are schools teaching kids during that 10 years in captivity?

Aside: I don't recall ever needing to do much work with arithmetic when studying calculus. Everything was symbolic. If one evaluated some integral as root PI over 6 or whatever that was good. No need to get the actual numerical result.
Memory in C++ is a leaky abstraction .

pidd
Posts: 2328
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Cobol in schools

Tue Jul 20, 2021 5:56 pm

Heater wrote:
Tue Jul 20, 2021 5:06 pm
ejolson wrote:
Tue Jul 20, 2021 3:52 pm
I'll add that many students who need help with calculus are actually having trouble with arithmetic.
Are you saying kids arrive at university with no skills in arithmetic or calculus?

If so, what the heck are schools teaching kids during that 10 years in captivity?
That is normal, many schools teach to pass exams, (if it says that, do this) rather than teach what is going on. Then the students carry on learning in that manner, if they have good memories they can get away with it until the get to masters level.

Most of the first year at Uni is re-doing GCSE & A-Level, if they don't they lose too many students.

I could go on about what examination board reps say behind the scenes when they sell their syllabus to schools - basically how questions are made to look really difficult but in reality the kids have to know very little to answer them - that is their sales pitch, you can get 30% of the marks with one weeks teaching, you can avoid all that big long topic because it only contributes 2% of the exam marks. etc.

User avatar
Gavinmc42
Posts: 5859
Joined: Wed Aug 28, 2013 3:31 am

Re: Cobol in schools

Wed Jul 21, 2021 1:58 am

If so, what the heck are schools teaching kids during that 10 years in captivity?
In US it seems to be CRT and diversity training.

We only send our kid to school to get socialized and get a break from him.
He learns more coding Roblox and in YT vids, not sure about tictac, yet apart from some dance moves?
Are you saying kids arrive at university with no skills in arithmetic or calculus?
Some are doing electronics and have never soldered and some refuse to code Arduino's
.
Most of the first year at Uni is re-doing GCSE & A-Level, if they don't they lose too many students.
Yep 1st year is about reteaching the basics, otherwise they never make it to second year.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Milliways
Posts: 727
Joined: Fri Apr 25, 2014 12:18 am
Location: Sydney, Australia

Re: COBOL in schools

Wed Jul 21, 2021 4:32 am

DougieLawson wrote:
Mon Jul 19, 2021 3:06 pm

I've written tens of thousands of lines of COBOL in the last year. It's a brilliant language for doing pounds and pennies calculations (PIC S9(5)V99).
So that would be one program?

I taught myself COBOL in the early 1970s, and found using COBOL for input, FORTRAN for number crunching and COBOL for output worked brilliantly on a CDC6600.

When we had to move to an in-house IBM compatible machine I had lots of fights with the IT department. They didn't have any problem with COBOL programs that took hours to run, but wouldn't let me run FORTRAN code that needed a few MB for 15 seconds.

It was also good for database access (using EDMS).

I still have some COBOL on punched cards stuck under the house.

User avatar
Gavinmc42
Posts: 5859
Joined: Wed Aug 28, 2013 3:31 am

Re: Cobol in schools

Wed Jul 21, 2021 6:04 am

Easier to make a punch card reader than 8" floppy disk reader?
https://maker.pro/pic/projects/diy-punc ... ontroller/

Got a few 8" disks and a box or two of 5 1/4" and 3 1/2" disks, don't have any way of reading them now.
Linux dropped support for IDE drives?
Hang on to those punch cards.

Old languages might survive longer than old code?
Is anyone worried enough about this that they are preserving things?
Artic Vault project has Cobol in it?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
DougieLawson
Posts: 41453
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Cobol in schools

Wed Jul 21, 2021 9:44 am

Gavinmc42 wrote:
Wed Jul 21, 2021 6:04 am
Easier to make a punch card reader than 8" floppy disk reader?
https://maker.pro/pic/projects/diy-punc ... ontroller/
Baudot paper tape is easier as it only needs five light sensors for the holes plus the sprockets make moving the tape and constantly reading a new value easy. A Hollerith card reader needs twelve sensors and a complex mechanism to move the card through the eighty positions (although you can always ignore 73 to 80 as they are only sequence numbers).

Yesterday I wrote a brand new CICS DL/I COBOL program. Just for the fun of it.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

User avatar
jahboater
Posts: 7194
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Cobol in schools

Wed Jul 21, 2021 10:57 am

To use COBOL on the Pi:

sudo apt install gnucobol

The compiler is called "cobc".

https://gnucobol.sourceforge.io/doc/gnucobol.html

cobc supports the current 2014 version.

User avatar
DougieLawson
Posts: 41453
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Cobol in schools

Wed Jul 21, 2021 11:00 am

jahboater wrote:
Wed Jul 21, 2021 10:57 am
To use COBOL on the Pi

sudo apt install gnucobol

The compiler is called "cobc".

https://gnucobol.sourceforge.io/doc/gnucobol.html
It's a bit quirky as it transliterates your COBOL into C then compiles that with plain old gcc.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

ejolson
Posts: 7579
Joined: Tue Mar 18, 2014 11:47 am

Re: Cobol in schools

Wed Jul 21, 2021 5:22 pm

DougieLawson wrote:
Wed Jul 21, 2021 11:00 am
jahboater wrote:
Wed Jul 21, 2021 10:57 am
To use COBOL on the Pi

sudo apt install gnucobol

The compiler is called "cobc".

https://gnucobol.sourceforge.io/doc/gnucobol.html
It's a bit quirky as it transliterates your COBOL into C then compiles that with plain old gcc.
Is there a better programming tool with which to learn COBOL on the Pi?

Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Wed Jul 21, 2021 5:46 pm

Gavinmc42 wrote:
Mon Jul 19, 2021 8:08 am
Do schools need to teach old languages too?
Sure, why not? Could be part of the history curriculum.

:)
Memory in C++ is a leaky abstraction .

User avatar
bensimmo
Posts: 5369
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Cobol in schools

Wed Jul 21, 2021 6:16 pm

Heater wrote:
Wed Jul 21, 2021 5:46 pm
Gavinmc42 wrote:
Mon Jul 19, 2021 8:08 am
Do schools need to teach old languages too?
Sure, why not? Could be part of the history curriculum.

:)
Latin is old and some still teach it.

Saying that even the up and coming Modern Foreign Languages like French, German and Spanish are going out a favour in many school.

User avatar
DougieLawson
Posts: 41453
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Cobol in schools

Wed Jul 21, 2021 6:27 pm

ejolson wrote:
Wed Jul 21, 2021 5:22 pm
Is there a better programming tool with which to learn COBOL on the Pi?
I don't know, because I still do my COBOL programming on a real mainframe using a 3270 emulator (Tom Brennan's Vista) with TSO and ISPF (with the screen set to 50 x 80) and Enterprise COBOL V6.2.

https://www.tombrennansoftware.com/ that's the best USD$30 I've ever spent for a piece of software.

I can't comment on folks using IKFCBL00 with that strange mainframe emulator (which runs OK on a RPi 3B+).
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Wed Jul 21, 2021 6:40 pm

bensimmo wrote:
Wed Jul 21, 2021 6:16 pm
Latin is old and some still teach it.
Indeed they do. And I think that is a good thing. Sadly it was not on offer when I was at school. Although I believe some Latin was still a requirement to get into any source at Oxford and Cambridge at the time.

Thing is much of English and other languages is derived from Latin. So Latin is kind of useful as a lesson in where the language you speak came from and why it is as it is.

I can't really see that the same can be said of COBOL. Are there any features of COBOL that inspired other languages and persist any programming language we commonly use today?

The programming language equivalent of Latin is more likely ALGOL. There are many features of common languages today that can be traced back to ALGOL and FORTRAN. A lineage all the way to the likes of Javascript and Rust via the likes of C and Pascal.

COBOL seems to have been an evolutionary dead end.

Or am I missing a point or two along the way?
Memory in C++ is a leaky abstraction .

pidd
Posts: 2328
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Cobol in schools

Wed Jul 21, 2021 7:09 pm

Latin is a relatively young language that was derived and developed from a real hotchpot of other languages, if any language should be regarded as the classical language it is Greek.

Additionally the the Greeks were the great mathematicians and mathematics is the basis of all programming languages.

I can safely say that my Latin education has not helped me one iota in life, as far as I am concerned it was wasted time when I could have been spending additional time on more relevant subjects like mathematics, physics or chemistry.

Yes, I can still rote off amo, amas, amat etc What the heck use is that?????

Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Wed Jul 21, 2021 8:35 pm

My point was that some knowledge of Latin is not necessarily useful but I think it's interesting as part of knowing where the language one uses comes from and why it is put together the way it is.

It does have use in helping learn foreign languages. Often those Latin roots help things click together.

A crazy example: The Finnish language is very different from every other language in Europe. The Finnish for "hangover" is "krapula". What the hell is that? However it turns out there is the word "crapulous" in English with much the same meaning. I believe there is similar in French.

Of course it all comes from the Latin "crapula" which of course comes from some Greek.

Then there was the time I had to go to the dentist while visiting Finland. She did not speak so good English and ended up describing my problem as "calculus". Of course I knew immediately what she meant.

Sic transit gloria mundi.
Memory in C++ is a leaky abstraction .

GlowInTheDark
Posts: 1824
Joined: Sat Nov 09, 2019 12:14 pm

Re: Cobol in schools

Wed Jul 21, 2021 8:47 pm

Then there was the time I had to go to the dentist while visiting Finland. She did not speak so good English and ended up describing my problem as "calculus".
calculus is a standard term in dentistry. I've heard it routinely used by hygienists (to refer to the stone-like buildup on your teeth).

calculus in mathematics, comes, of course, from the Latin word for pebble.
Poster of inconvenient truths.

Linux zealot and proud of it.

User avatar
jahboater
Posts: 7194
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Cobol in schools

Wed Jul 21, 2021 9:04 pm

Heater wrote:
Wed Jul 21, 2021 6:40 pm
bensimmo wrote:
Wed Jul 21, 2021 6:16 pm
Latin is old and some still teach it.
Indeed they do. And I think that is a good thing. Sadly it was not on offer when I was at school. Although I believe some Latin was still a requirement to get into any source at Oxford and Cambridge at the time.

Thing is much of English and other languages is derived from Latin. So Latin is kind of useful as a lesson in where the language you speak came from and why it is as it is.

My point was that some knowledge of Latin is not necessarily useful but I think it's interesting as part of knowing where the language one uses comes from and why it is put together the way it is.
Yes exactly
I once had a girlfriend who was a linguist and worked as a professional translator. She was fluent in several European languages. She said that Latin was essential for her career.
When she had trouble understanding something in a particular language, she would go to the Latin and work back from there.
Her friend who had not learned Latin was at a professional disadvantage.
Heater wrote:
Wed Jul 21, 2021 6:40 pm
The programming language equivalent of Latin is more likely ALGOL. There are many features of common languages today that can be traced back to ALGOL and FORTRAN. A lineage all the way to the likes of Javascript and Rust via the likes of C and Pascal.
That is a good analogy.

Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Wed Jul 21, 2021 10:11 pm

GlowInTheDark wrote:
Wed Jul 21, 2021 8:47 pm
calculus is a standard term in dentistry. I've heard it routinely used by hygienists (to refer to the stone-like buildup on your teeth).

calculus in mathematics, comes, of course, from the Latin word for pebble.
Yes indeed.

Thing is I did not know anything of dentistry termology. Still don't much.

I just happened to remember being told where the word "calculus" came from in mathematics.
Memory in C++ is a leaky abstraction .

dbrion06
Posts: 511
Joined: Tue May 28, 2019 11:57 am

Re: Cobol in schools

Thu Jul 22, 2021 6:16 am

However it turns out there is the word "crapulous" in English with much the same meaning. I believe there is similar in French.
this was similar in French: now, one does not need to be drunk to steal a poor old war hero's wooden leg, an old woman golden teeth, laugh at the victims and murder a competitor("crime crapuleux").

BTW : I never used Cobol, but messeems brought the idea of data structures (records).
Fortran, with terrible goto (scared people, asking for better ideas) and loops (showd what could turn into a good idea) inspired program structures

pidd
Posts: 2328
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Cobol in schools

Thu Jul 22, 2021 11:05 am

I'll take the bait :lol:

Nothing wrong with goto, a loop is only a conditional goto except without a dedicated target label.

Goto can often be a lot more efficient than loops. Despite the puritan loop ethos, almost every language has added some form of escape from a loop which is contrary to the structural concept of loops.

Next (or its equivalents) in a for next loop is 100% a goto except again it doesn't have a unique label, for-next loops do not use the stack in most languages. Some other loops are effectively subroutines which do use a stack.

Even if the language doesn't have a goto you can guarantee the object code is using goto/jump/branch or whatever.

The only occasion where goto is questionable is when using line numbers as targets instead of labels because the target is not identified clearly and/or uniquely as an entry point and that is where and when goto got a bad rep. "goto label" is as structurally sound as a loop, if not more so in many languages because its target is unique.

Both loops and goto can break structure, loops though incorrect nesting and goto for jumping inside or out of a loop, all of these can easily be picked up by the compiler/interpreter.

Basically goto is a valid structure provided unique target labels are used.

dbrion06
Posts: 511
Joined: Tue May 28, 2019 11:57 am

Re: Cobol in schools

Thu Jul 22, 2021 11:48 am

Well, if gotos are that useful, I am glad to know assembly has such things (I have not used assembly since decades, as optimizers can automagically produce faster code than a human being).
gotos made programs complicated to read/maintain...
ratfor https://packages.debian.org/search?keywords=ratfor was invented by Kerninghan to have structured Fortran66 (Fortran77 was to a given extent structured, F66 was not and F77 become quickly accepted).
F was used to train people not using goto s (a funny compiler) in F>=90 (R and python do not have gotos, next, break and early return do the job, in the rare cases gotos can be felt useful)
BTW: C has better goto (readable label) than fortran (meaningless number): there is a tiny chance one can understand, maybe even improve a goto plagued C program.

User avatar
jahboater
Posts: 7194
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Cobol in schools

Thu Jul 22, 2021 1:23 pm

pidd wrote:
Thu Jul 22, 2021 11:05 am
Basically goto is a valid structure provided unique target labels are used.
Things like "break" or "continue" in C are jumps in a forward direction only to a language defined target only.

They are therefore much safer than a "goto" jump to some random location, forwards or backwards.

Also these constraints facilitate the various types of analysis done by the compiler.

Goto's are sometimes useful - when used with great care they may occaisonally simplify code - but its not common.

But to say that goto's are OK because the the compiler itself emits them for normal code is just wrong.

GlowInTheDark
Posts: 1824
Joined: Sat Nov 09, 2019 12:14 pm

Re: Cobol in schools

Thu Jul 22, 2021 2:50 pm

Gosh! Another GOTO debate!

Shouldn't we be discussing vi vs. emacs?
Poster of inconvenient truths.

Linux zealot and proud of it.

pidd
Posts: 2328
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: Cobol in schools

Thu Jul 22, 2021 3:34 pm

I thought "readability" has gone out of the window, almost every piece of 3rd party code I see these days is un-commented, most don't even bother with a description of its functionality at the beginning.

How you choose to indent and comment your code is the the most important element of readability and that applies as much to using goto as any loop.

When you end up with fudges like "while true;" any claim of structural soundness is futile.

Surely these are identical structures

Code: Select all

loop1:
    print "hello world"
goto loop1

Code: Select all

while true
    print "hello world"
wend
Clearly the second one is a kludge to get round structural purity, I'd also bet that any non-programmer can read the first correctly but at least have to think about the second. So which one is more readable?

Yes, badly written counter-examples can be created but that is also true without using goto, not a result of using goto..

Heater
Posts: 18362
Joined: Tue Jul 17, 2012 3:02 pm

Re: Cobol in schools

Thu Jul 22, 2021 5:11 pm

pidd wrote:
Thu Jul 22, 2021 3:34 pm
I thought "readability" has gone out of the window, almost every piece of 3rd party code I see these days is un-commented, most don't even bother with a description of its functionality at the beginning.
I don't know. In the world I inhabit code is very well commented. For example: https://doc.rust-lang.org/src/core/iter ... ml#99-3416. I think you will find an order of magnitude more documentation in there than actual code. Which automatically gets to generate docs like: https://doc.rust-lang.org/std/iter/trait.Iterator.html
pidd wrote:
Thu Jul 22, 2021 3:34 pm
How you choose to indent and comment your code is the the most important element of readability and that applies as much to using goto as any loop.
I agree. Indenting in a consistently is a very good idea. Especially if you do it like everyone else using the same language.
However is use of goto has severe problems.
pidd wrote:
Thu Jul 22, 2021 3:34 pm
When you end up with fudges like "while true;" any claim of structural soundness is futile.
Please explain. That makes no sense to me. If one really wants an endless loop in a structured manner it has to look like:

Code: Select all

do forever
    something
The C "while true" syntax follows that very well. I see no "fudge".

Rust does it a little bit better perhaps:

Code: Select all

loop {
    something
}
pidd wrote:
Thu Jul 22, 2021 3:34 pm
Surely these are identical structures

Code: Select all

loop1:
    print "hello world"
goto loop1

Code: Select all

while true
    print "hello world"
wend
No, they are not.

What you are forgetting is that once you have a label like "loop1" and the possibility of "goto" then there could be many other places in your code that "goto loop1". Not just the one at the end of your intended loop. It is not possible to understand what your "goto" version of the loop does unless you have checked all the rest of the code to see if there are any other places that "goto loop1". But the "while" version is self contained and very explicit about the possibilities.
pidd wrote:
Thu Jul 22, 2021 3:34 pm
Clearly the second one is a kludge to get round structural purity, I'd also bet that any non-programmer can read the first correctly but at least have to think about the second. So which one is more readable?
Again, I don't understand why you say "kludge" there. It is not "getting around structural impurity" it is implementing it!

I'm sure non-programmers have no problem with directions like:

Code: Select all

While the universe has not ended do the following sequence of actions:
    stand on your head,
    drink a pint of bear,
    stand on your feet.
    drink a pint of wate.
I will claim that "goto" is a weird concept about machine instructions addresses or source code line numbers/labels that are even less fathomable to the layman.
pidd wrote:
Thu Jul 22, 2021 3:34 pm
Yes, badly written counter-examples can be created but that is also true without using goto, not a result of using goto..
Yeah. But banning goto results in more understandable code. Not only that it makes for code that is amenable to analysis by compilers and hence better optimisation and error checking. It allows for use of vectorization and even automatic parallelisation.
Memory in C++ is a leaky abstraction .

Return to “Other programming languages”