4 ms·
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 machine
by djsumdog 9y ago
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 jobs for several years. All I can find here is Java work and I dread going back to the god awful word of Spring Boot+MVN+Java after having worked with a considerably better language (usually :-P).
We have better tools today, but the world is left in legacy. So few things have unit/automated tests and without a good crew of engineers, it's very difficult to move things quickly and smoothly to new systems and platforms. Just because COBOL is still in use in so many systems doesn't make it good. It just got popular at the right time, everyone embraced it, and now people who still do it are paid insane amounts of money just to maintain it.
Here's one of my old COBOL programs from University. It was written 15 years ago. I converted from CVS to Git, so the history dates are literally older than github, which is kinda funny:
https://github.com/sumdog/assignments/blob/master/csc3620-program3/prog3.cob https://github.com/sumdog/assignments/blob/master/csc3620-pr...
- chris_wot 9y agoThat’s actually quite readable
- the_af 9y agoReadability 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?
- chris_wot 9y agoSure, if the money was right. I actually know a bit of COBOL, most of it forgotten. After a while I would move on if they didn’t give me other projects, but I’d even be willing to do it in parallel.
- the_af 9y agoNot sure if I understand you. Isn't "if the money was right" another way of saying "if forced by the customer/platform"? In other words, if the customer told you "pick the language you want" and the platform wasn't a mainframe, why would you choose COBOL?
- chris_wot 9y agoWell, I wouldn't. The language has a lot of shortcomings. All I was saying was that it was fairly readable.
- elygre 9y agoI’d be curious to see that in Scala — would it be any more readable?
- the_af 9y agoYes. It's certainly going to be shorter, and if you're familiar with modern programming idioms, also more understandable.