3 ms·
Oh man, I always wanted to learn more about COBOL. People like to crap on the language, but this article makes it seem like it's not that bad, actually. I cou
by ainar-g 7y ago
Oh man, I always wanted to learn more about COBOL. People like to crap
on the language, but this article makes it seem like it's not that bad,
actually. I could see myself programming that, for a large sum of money
of course.
With that said, the real COBOL code is probably much more horrifying,
when you consider, just how much uglier real-world code is compared to
small tutorials and review articles. I would really like to read
a series of “COBOL War-Time Stories”.
- seanhunter 7y agoA good place to start would be use a modern COBOL web framework, such as COGS http://www.coboloncogs.org/HOME.HTM http://www.coboloncogs.org/HOME.HTM
- thanatropism 7y agoI wonder if it's possible to write a Lisp-like (such as Clojure or Hy) that compiles to COBOL in an interoperable fashion.
- DrScump 7y agohow much uglier real-world code is One of my first projects in COBOL was to complete a rewrite, using structured programming, of a report writer that dated back into the 1960s. If you think COBOL is hard to follow, imagine COBOL code laden with gotos and older than the 1968 standard.
- Starwatcher2001 7y agoYeah, that sounds fun. Did that have the evil "alter" statement, which caused even more spaghetti with gotos?
- DrScump 7y agoI think ALTER usage was formally disallowed.
- ben509 7y agoThe string manipulation he's doing is already pretty gory, though I think COBOL has better facilities that he's not taking advantage of.
- coleca 7y agoI wrote a ton of COBOL (mainframe and MicroFocus COBOL on AIX) back in the day in my early IT career (late 90s, early 2000s) around the Y2K conversion. It was a fun language because you could pick up someone else's code and be productive right away. It was hard (but not impossible) to do things in COBOL that weren't pretty straight forward. One of the big drawbacks we had though, and this may have changed since, was that COBOL wanted every variable and structure to be fixed length and defined up at the top of the program. So it was not really a good fit for the modern world of the web, JSON, etc. where you don't always know the length or structure of your input in advance. The versions of COBOL we used wouldn't have been able to process a blob of JSON and pull out a particular key for example without having the full JSON structure defined beforehand. I always joke w/my colleagues that my copy of "COBOL For Dummies" on my bookshelf is as good as my 401k as a retirement plan.
- the_af 7y ago> I wrote a ton of COBOL (mainframe and MicroFocus COBOL on AIX) back in the day in my early IT career (late 90s, early 2000s) around the Y2K conversion Haha, same here! I owe Y2K my first paid programming job. > It was a fun language Nope. You lost me there. COBOL still gives me nightmares. It was the most profoundly unfun language I've ever had the misfortune to be forced to work with.
- commandlinefan 7y ago> makes it seem like it's not that bad, actually That’s because it was written by somebody who just learned it. It looks fine when you just learn it, until you actually try to solve real problems with it, and then the weakness of its simplicity become very painfully obvious.
- AdieuToLogic 7y ago> Oh man, I always wanted to learn more about COBOL. People like to crap on the language, but this article makes it seem like it's not that bad, actually. IDENTIFICATION DIVISION. PROGRAM-ID. WELCOME-TO-COBOL. DATA DIVISION. WORKING-STORAGE SECTION. 01 MAKES-PROGRAMMING-FUN PIC 9(9). 01 ALL-VARIABLES-ARE-GLOBAL PIC 9(9). PROCEDURE DIVISION. A000-FIRST-PARA. MOVE 0 TO MAKES-PROGRAMMING-FUN. MOVE 1 TO ALL-VARIABLES-ARE-GLOBAL. IF ALL-VARIABLES-ARE-GLOBAL = MAKES-PROGRAMMING-FUN THEN DISPLAY '20 LINES OF CODE TO SAY ENJOY COBOL!' ELSE DISPLAY 'USE A BETTER LANGUAGE' END-IF. STOP RUN.