9 ms·
Oh my God. I wasted a year of my life on a COBOL project. It is easily the worst language I have ever used. There is a reason that COBOL is a linguistic dead-e
by maxharris 9y ago
Oh my God. I wasted a year of my life on a COBOL project. It is easily the worst language I have ever used.
There is a reason that COBOL is a linguistic dead-end! Functions? Sensible limited variable scope? A decent approach to handling whitespace so that complex, nested branches make sense? COBOL doesn't even have these basics.
Want to declare a variable? You're gonna have to type weird stuff like this: `07 GreatVariableName PIC X(10).`
Oh yeah, and the compiler cost me $3k (great job, Micro Focus), on top of the Solaris machine I had to buy to run it. (This project happened to use `mmap()` via FFI, so it had to run on a Unix machine...)
Maybe I'm a bit bitter, but I will never touch another line of COBOL again.
- djsumdog 9y agoThe 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.
- agumonkey 9y agoIBM has been trying to fix this for decades. Either through UML/OO interfacing [not kidding], or 4GL language (a slightly more modern language with cobol use case in mind). I don't despise COBOL, it's mostly a reporting mindset language. Fitted with record file systems you can do some stuff. But if you step outside .. god help you. And if you use X-to-COBOL compilers, then even god cannot help you. Pages and pages of mangled COBOL terms. People show you printouts like war scar tissue on your first day to assert senior status :D
- CaptainZapp 9y agoAnd if you use X-to-COBOL compilers, then even god cannot help you. Exactly this! I started my professional carreer with COBOL, which I still don't deem to bad for what it was designed. But we were forced to use Jackson Structured Programing implemented via a pre-compiler (which conveniently ceased to work in regular intervals, since the license expired, but I digress). You're right! God would have run screaming after one look at the resulting garbage code if we would have the impertinence to ask for help.
- i_feel_great 9y ago>>Functions? Sensible limited variable scope? A decent approach to handling whitespace so that complex, nested branches make sense? COBOL doesn't even have these basics. >>Want to declare a variable? You're gonna have to type weird stuff like this: `07 GreatVariableName PIC X(10).` I am experiencing this hateful pain and suffering right now. And the previous maintainers hated it too and cut and paste stuff in and out and the files are ~10k lines long and trying to track where a variable has changed, only to find that it depends on another two or more variables, and then trying to track those... Don't do it folks.
- wvenable 9y agoI spent a little less time that you doing COBOL and I've never been less productive as a programmer in my life. The language is terrible and the ecosystem is worse. What should take a week to code and deploy took months. To answer the topic, I've tried COBOL and I hate it. It doesn't deserve respect except in a historical context.