News for hackers. Stuff that matters.
Re:The Beauty of COBOL (2018) by ainar-g on Friday October 18, 2019 @01:53AM (#21289014)
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”.

Re:The Beauty of COBOL (2018) by DrScump on Friday October 18, 2019 @02:32AM (#21289138)

  how 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.
Re:The Beauty of COBOL (2018) by Starwatcher2001 on Friday October 18, 2019 @11:07AM (#21292002)
Yeah, that sounds fun. Did that have the evil "alter" statement, which caused even more spaghetti with gotos?
Re:The Beauty of COBOL (2018) by DrScump on Thursday October 24, 2019 @06:18PM (#21349774)
I think ALTER usage was formally disallowed.
Re:The Beauty of COBOL (2018) by AdieuToLogic on Saturday October 19, 2019 @12:23AM (#21296745)
> 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.
Re:The Beauty of COBOL (2018) by commandlinefan on Friday October 18, 2019 @11:00AM (#21291936)
> 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.

Re:The Beauty of COBOL (2018) by coleca on Friday October 18, 2019 @09:11AM (#21291056)
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. 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.

Re:The Beauty of COBOL (2018) by the_af on Friday October 18, 2019 @04:52PM (#21294980)
> 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.

Re:The Beauty of COBOL (2018) by seanhunter on Friday October 18, 2019 @03:58AM (#21289473)
A good place to start would be use a modern COBOL web framework, such as COGS http://www.coboloncogs.org/HOME.HTM
Re:The Beauty of COBOL (2018) by thanatropism on Friday October 18, 2019 @08:03AM (#21290590)
I wonder if it's possible to write a Lisp-like (such as Clojure or Hy) that compiles to COBOL in an interoperable fashion.
Re:The Beauty of COBOL (2018) by ben509 on Friday October 18, 2019 @02:42AM (#21289182)
The string manipulation he's doing is already pretty gory, though I think COBOL has better facilities that he's not taking advantage of.