News for hackers. Stuff that matters.
Re:The mainframe is alive and thriving by gumby on Thursday March 11, 2021 @05:31PM (#26429837)
I understand and agree with your point but hey, I got a lot of benefit from learning Latin, arguably more than I got for learning Lisp (which was is what I used for the first 10 years of my career. It was a fun and quite lucrative period).

For graduates of my (very small) high school, Classics was the number one choice of college major and though I'm not in close touch with all of them I never heard any of them claim that they had made a mistake.

Cobol is sort of like Lisp* in that regard: the options are quite limited, but as the supply is too you'll probably do better than fine financially.

* wow is it painful to write that.

Re:The mainframe is alive and thriving by konjin on Thursday March 11, 2021 @09:16PM (#26431538)
Lisp is interesting because it always has a first mover advantage in any field, i.e. I can code up something that does 80% of what I want in 10% of the time of any other language. Cobol's only use is that it's entrenched.

Which is why I used the vatican comparison.

Re:The mainframe is alive and thriving by kazinator on Friday March 12, 2021 @01:18PM (#26438935)
In a nutshell, Cobol fails to inspire throngs of youngsters to write "toy Cobol" implementations.

It is also relatively rare for new languages cite Cobol as an inspiration for any of their features.

Cobol has a feature whereby dissimilar structures can be assigned. The structure members which have the same names are identified between the structures and the data is moved accordingly. Or something like that. A programming language which has such a thing could claim to have had that inspired by Cobol.

If I ever add that to TXR Lisp, I will be sure to drop a Cobol reference into the documentation.

I might have learned about this via Knuth; I think there is a mention of it in some passage in TAOCP.

Re:The mainframe is alive and thriving by svat on Friday March 12, 2021 @07:02PM (#26442474)
> I might have learned about this via Knuth; I think there is a mention of it in some passage in TAOCP.

Indeed, see Volume 1, section 2.4 (Multilinked Structures). Page 426 has the example of the statement “MOVE CORRESPONDING DATE OF SALES TO DATE OF PURCHASES”, which, if I understand correctly, means something like “for each field foo in Purchases.Date, copy Purchases.Date.foo into Sales.Date.foo”.

The discussion is in the context of what kinds of data structures would be needed to compile such statements, which I guess makes sense considering that the original publisher offer for TAOCP was to write about everything a programmer would need to know to write a (60s-era) compiler.

(Coincidentally: I've started attending an online meetup that someone is running for reading TAOCP—we usually read about four pages in the two hours—and this is the very topic that we're going to read tomorrow.)

Re:The mainframe is alive and thriving by gumby on Friday March 12, 2021 @03:30PM (#26440508)
> Cobol has a feature whereby dissimilar structures can be assigned. The structure members which have the same names are identified between the structures and the data is moved accordingly. Or something like that.

This horrifies me on several levels, though I suppose it could be considered a sort "cast to a superclass".

Re:The mainframe is alive and thriving by kazinator on Friday March 12, 2021 @03:38PM (#26440590)
It seems to make sense in data-oriented programming. Say you want to create an invoice from a purchase_order or something. They have the same the order number, items, and figures. Just assign one to the other (or use it as a template for construction) to get the common values in, and fill in the rest.