Live data from Hacker News

Ask HN: Has anyone here learned COBOL for fun?

news.ycombinator.com

51–60 of 82 posts

Re: Ask HN: Has anyone here learned COBOL for fun?

#51
post #6

I messed around with it, thinking it seemed interesting and could be useful to know Just-In-Case. One thing I didn't get, until I started messing with it, is that COBOL isn't a general purpose language. There's a whole category of things it just can't do, and if you ask about it you'll just be told "COBOL isn't C". There's another set of things it's really effective at, primarily transactions and large iterations. Me…

Curious what the limitations were.

Anecdotally I was talking with a COBOL vendor way back in the mid-80s and he had mentioned that their COBOL compiler was itself written in COBOL.

FORTRAN also suffered limitations back in the day, notably lack of dynamic memory, yet folks were able to write sophisticated systems in it as well.

Re: Ask HN: Has anyone here learned COBOL for fun?

#52
post #24
post #17

I've actually seen some of the COBOL that underpins these financial entities. Typically the code base and writing style has morphed into a number of nearly incompatible dialects over the decades it has ran at these places. I've never really learned enough about it to understand copybooks and the other functions/file types it has.

Decade? My team once happened to maintain a file that was originally checked-in in the 1970s... (edit: Not sure if I'm more in awe of the fact that the procedure was still used or because mainframe code was under version control in the 70s and you still can see who did what and why).

Decades with an 's', yea, this code has been around a very long time in most cases.

Re: Ask HN: Has anyone here learned COBOL for fun?

#53
post #6

I messed around with it, thinking it seemed interesting and could be useful to know Just-In-Case. One thing I didn't get, until I started messing with it, is that COBOL isn't a general purpose language. There's a whole category of things it just can't do, and if you ask about it you'll just be told "COBOL isn't C". There's another set of things it's really effective at, primarily transactions and large iterations. Me…

Curious what the limitations were. Anecdotally I was talking with a COBOL vendor way back in the mid-80s and he had mentioned that their COBOL compiler was itself written in COBOL. FORTRAN also suffered limitations back in the day, notably lack of dynamic memory, yet folks were able to write sophisticated systems in it as well.

It lacks a whole slew of things you would expect in a GP language, or requires you to jump through massive hoops to achieve the same results.

Imagine trying to program a desktop application in SQL. You could probably achieve it through some use of triggers and interfaces, but it would be a nightmare. It's not quite as bad for COBOL, but a similar story.

Re: Ask HN: Has anyone here learned COBOL for fun?

#54
post #7

I did an internship in 2009-2010 with a company who used MicroFocus “AcuCOBOL” to modernize a green-screen automotive dealership management system into a Windows GUI. I wouldn’t say I did it for fun, but I did do it for the learning experience. My university was very invested in COBOL, and I had classmates who got offers much larger than mine to work for various finance companies in Wisconsin, so I had already learne…

> It’s hard for me to separate the COBOL from all of the other dysfunctional things going on at the company. I knew that the language was a dead-end and did not want to get stuck with it. Not because I didn’t like the language, but because I was 21 and “Web 2.0” was in full swing and I knew I wanted to do something “cool”. I think this is an often under-appreciated point -- languages don't live in isolation, but with…

I couldn’t agree with this more.

To me, there’s an ecosystem and a culture for a language in a situation.

The ecosystem is the tooling around the language. Debugging, performance profiling, building and dependency management are examples.

The culture is how the language is used in real life. How stable is the ecosystem?

There are lots of beautiful languages that are used horrifically. Enterprise OOP is an example for me where more than half the code is dedicated to avoiding basic principles for “what if we want to change later” (looking at you getters and setters).

And within a company or software suite, there can be subcultures of how “we” use the language. Every class needs an interface. Our C is written OO (see old GNOME).

For the ecosystem you have extremes. C where debugging and performance profiling are well defined practice, but modern dependency management doesn’t exit. The JavaScript ecosystem changes so rapidly, documentation is usually out of date, “nobody does that anymore”, etc.

And so much awful comes from trying to force a language into something the language wasn’t originally designed or even used for. Your Haskell example here. Adding functional language features and convoluted asynch to every freaking language is another. People create things much harder to learn than a new language with a mature ecosystem and culture in a domain just to avoid “learning a new language.”

In woodworking, I can do pretty much anything with a chisel. But I plane with a plane, saw with a saw, use specialty planes for rabbets, etc. Each has a learning curve, but I’ll end up with a better, more consistent result. And really, they’re all just chisels with jigs in different configurations. But I’m going to use a chisel where it’s still best, like mortising. Well, and where I’m not sure I want to invest in a more specialized tool yet and risk my wife killing me. Then I use C… I mean, a chisel.

Re: Ask HN: Has anyone here learned COBOL for fun?

#55
post #9

I wouldn’t say I learned it “for fun”, but when my sister was in college (25 years ago) as a business information systems major (or something like that), she had to take a Cobol course so I learned enough of it to help her get through the class. Next semester, she told me she had to take a second Cobol class. I told her I was done with Cobol and she switched majors.

My girlfriend in High School and college was taking "Secretarial Science" like her mother but took Cobol for a laugh, maybe because I was taking every other language. Right out of college she got a job as the bum she married finally finished college on her nickel.

Re: Ask HN: Has anyone here learned COBOL for fun?

#56
Back in the 80's a friend and I took a COBOL course at a community college in the evening when we were in high school. Most students were much older than we were.

We wrote our programs on special pads of paper, transferred them to punch cards, gave our decks to operators who would run our programs on an IBM. Around a half hour later the operators gave us back printouts with the results of our runs. Most people didn't wait around but my friend and I would stay late so we could get more runs in. If we were nice to the operator they might bump our job up in the queue.

Most of the programs we wrote were very simple. Things you could easily do now with a few lines of a modern scripting language.

Our class's teacher was a professional COBOL programmer who had a day job working at a soda company. Some kind of emergency came up at his job half way through the course and he stopped showing up so we were left on our own for a few weeks.

Just before the end of the class the department head took over and told everyone they would need to implement a binary search on the final exam. This was way too hard for most of the other students but not a big deal for my friend and I. We were done in a few minutes.

I was also fortunate to meet another guy in the class who asked me to help him with some programs he had to write at his job. He was a soil engineer who wanted to move into a finance job but found the programming work difficult, so I spent a few hours a week tutoring him and writing programs with him.

Eventually I graduated and he ran out of work for me but by then we became good friends. While I can't say I got much out of of the COBOL class I'm glad I took it because if I hadn't I would not have met him.

Re: Ask HN: Has anyone here learned COBOL for fun?

#57
post #50
post #28

Earlier quoted context omitted.

I'm with you on the idea that mainframe COBOL is typically only part of the actual program. But COBOL not being Turing complete sounds...not right.

I'm not using the formal definition here -- I meant that there are programs you can write in other mainstream programming languages that just can't be expressed in COBOL due to limitations on recursion. The COBOL spec doesn't allow recursive "paragraphs" (functions), though some implementations support it. (This may no longer be the case, or this limitation may have been specific to the language version used at my jo…

Recursion is not necessary for Turning completeness.

Recursion and loops are interchangeable.

Re: Ask HN: Has anyone here learned COBOL for fun?

#58

I read 'Kill It with Fire: Manage Aging Computer Systems (and Future Proof Modern Ones)' and the whole time I kept thinking that learning one of these old languages could be fun and would be a good side project. Would definitely be a lot of good projects to work on if you looked for them as paid gigs.

I think the author was a part of US Digital Service, which works to modernize government systems. Seems like fascinating and frustrating work.

Re: Ask HN: Has anyone here learned COBOL for fun?

#59
We're doing Mainframe modernizations/integrations with the cloud @Mechanical Orchard. It's been really fun to see and learn the entomology of how computing got to where it is today.

As other folks have described programming on the mainframe is about learning COBOL + JCL. I would also add that you need to understand how to read/write binary files according to a defined schema (Copybook) and encoding (EBCDIC, COMP, COMP-3, COMP-5). It's also helpful to deeply understand the intricacies of Db2 and different methods of connection (ODBC, JDBC, Db2 CLI).

I've even gone so far as to write an ODBC extension for DuckDB so that we can scan and process queries faster and with less MIPS usage. https://github.com/rupurt/odbc-scanner-duckdb-extension

https://www.mechanical-orchard.com

Re: Ask HN: Has anyone here learned COBOL for fun?

#60
post #50
post #28

Earlier quoted context omitted.

I'm with you on the idea that mainframe COBOL is typically only part of the actual program. But COBOL not being Turing complete sounds...not right.

I'm not using the formal definition here -- I meant that there are programs you can write in other mainstream programming languages that just can't be expressed in COBOL due to limitations on recursion. The COBOL spec doesn't allow recursive "paragraphs" (functions), though some implementations support it. (This may no longer be the case, or this limitation may have been specific to the language version used at my jo…

It was somewhat dependent on your job, although the norm is no recursion.

From Wikipedia "other compilers, like IBM COBOL, will produce code that prints "1 2 3 END END END END ..." and so on, printing "END" over and over in an endless loop." [1]

Also, having never used COBOL, the PERFORM statement is pretty cool. Like calling arbitrary parts of a Switch statement with a single line. Would be neat if some other languages had that.

[1] https://en.wikipedia.org/wiki/COBOL#Procedures

Post reply on HN