Live data from Hacker News

Don't hate COBOL until you've tried it

opensource.com

61–70 of 139 posts

Re: Don't hate COBOL until you've tried it

#61
post #57
post #54

Earlier quoted context omitted.

> If you want to make it more popular I don't think that's a desirable goal. COBOL is not a very good programming language: it's verbose, clunky, cumbersome and outdated. It still exists because of tons of legacy systems and (understandably) conservative businesses like banks. But if you start a new project, please DON'T consider COBOL. To be honest, even my recommendation is irrelevant: you wouldn't start a new COBO…

It was just an assumption, based on someone writing an article called "Don't hate COBOL until you've tried it". As said, I personally wouldn't even consider it, so there is zero chance to hate it as well.

Yes, it wasn't a criticism of your post! Just a clarification, namely, that I think COBOL evangelism is misplaced, because you're either forced to use it by your customer (often, a bank or similar institution) or you are not, in which case there are plenty of better, modern languages you should use instead. In either case, you don't need someone convincing you to use COBOL. If you're unaware of this language, you don't need it :)

Re: Don't hate COBOL until you've tried it

#62
Don't like COBOL but the way it specifies data formats was practical. 9(5) = 5 digits, X(20) = 20 characters, etc. From time to time I catch myself using these while drafting a table or data structure.

Re: Don't hate COBOL until you've tried it

#66

I once had to port COBOL to Java. It presented some interesting problems because of EBCDIC, nibbles, non IEEE arithmetic, and alien data formats. A long story short: there are problems where COBOL is better suited than Java.

Were you also moving from a mainframe to a server? I would have thought that Java on a mainframe would handle EBCDIC just fine, but I have never tried it.

Re: Don't hate COBOL until you've tried it

#67
post #4

Earlier quoted context omitted.

The last time I touched it was in undergrad. I remember a professor in my assembly class was showing us old punch cards. They were made with the fancier machines where it printed the line of code on the bottom of the card. I look at the lines in the stack and was like, "Wait, is this ... is this COBOL?" I have to agree. Even back in 2001, I found COBOL awful. I recently moved to a new city after having worked Scala j…

That’s actually quite readable

Readability is relative, of course. It's more readable than assembly language, compared to which COBOL is a win (for its intended use, of course). Compared to GW Basic (or any Basic with line numbers) it's probably about the same, though more verbose. Compared to a modern language, it's less readable and full of bizarre boilerplate.

The question is, if you are not forced by a customer (such as a bank) or by the need to maintain a legacy system, why would you willingly choose COBOL?

Re: Don't hate COBOL until you've tried it

#68

I have not used COBOL for 30 years but the language deserves respect. The transition from assembler to COBOL was one of the biggest productivity improvements in the history of programming, comparable to the introduction of Java and VM-based programs in the 1990s. COBOL is still pretty efficient for tasks like scanning data on magnetic tapes--not that most of us do that any more. In fact it was pretty good for any pro…

> because you could control the data layouts very precisely You can do that in assembly too

Ah. I’ve been downvoted... Guess I should’ve been more clear. I was referencing how the OP said COBOL was easier for data layouts. So, not really knowing COBOL, I was asking why. Poor wording.

Re: Don't hate COBOL until you've tried it

#69
post #44

Earlier quoted context omitted.

I don’t think COBOL does force you to mix concerns. You could create sub modules / services which you call from a main program to do things like file writing or database reading. Java doesn’t also say you have to separate concerns. You could easily write a single method which mixes business logic and IO (file and DB) When writing a batch program you need a balance between understanding it, making it efficient and rel…

>>> Java doesn’t also say you have to separate concerns. Sure, I was talking from inside my own enterprise-context where Java actually means Java + Spring + a few other things that force you to separate concerns (for the better imho, although it doesn't help with code navigation) >>> The thing that has always let COBOL down for me is the lack of automated testing. True.

I don't think most of those things are pluses for COBOL really, but if the alternative was what the Enterprise Java world has been doing for the past 10 or 15 years, bring on the COBOL.

Re: Don't hate COBOL until you've tried it

#70

I never tried it, but a friend of mine who wrote COBOL for a bank was offered a huge bonus for postponing his retirement for a year, and he refused because he was so sick of the language (he still likes programming, by the way). So I don't hate COBOL, but I'm not particularly interested in trying it either.

I got a nice stock offer to stay with a company doing COBOL for 3 years around Y2K. Of course I took it. By the time the three years had elapsed the stock price had more than doubled. I only eventually got out of COBOL because it was boring.

Years later I was between gigs and interviewed with a company that wanted me to go back to COBOL. I would have, but they lo-balled the salary, like I was going to take a $20K pay cut to go back to COBOL! Ended up staying in the Java world

Post reply on HN