Slashdot Mirror


Don't Count Cobol Out

Hugh Pickens writes "Although Turing Award-winning computer scientist Edsger Dijkstra once said, 'the use of Cobol cripples the mind; its teaching should, therefore, be regarded as a criminal offense,' Michael Swaine has an interesting entry to Dr. Dobb's Journal asserting that Cobol is the most widely used language in the 21st century, critical to some of the hottest areas of software development today, and may be the next language you'll be learning. In 1997, the Gartner Group estimated that there were 240 billion lines of Cobol code in active apps, and billions of lines of new Cobol code are being written every year. Cobol is a key element in the realization of modern distributed business software architecture concepts — XML/metadata, Web Services, Service Oriented Architecture — and e-business."

5 of 274 comments (clear)

  1. Cobol defeated da Terminator by schwaang · · Score: 5, Informative

    Gov. Schwarzenegger ordered a cut in pay to California state workers, and was told that it would be impossible to implement because the payroll system is in Cobol and nobody can touch it.

    Sounded like political bull to me, but then again...

    1. Re:Cobol defeated da Terminator by red_dragon · · Score: 5, Informative

      000100 IDENTIFICATION DIVISION.
      000200 PROGRAM-ID.     KILL-SARAH-CONNOR.
      000300
      000400*
      000500 ENVIRONMENT DIVISION.
      000600 CONFIGURATION SECTION.
      000700 SOURCE-COMPUTER. SKYNET.
      000800 OBJECT-COMPUTER. T-800.
      000900
      001000 DATA DIVISION.
      001100 FILE SECTION.
      001200
      100000 PROCEDURE DIVISION.
      100100
      100200 MAIN-LOGIC SECTION.
      100300 BEGIN.
      100400     PERFORM UNTIL SarahConnorIsDead.
      100500         FIND SARAH CONNOR.
      100600         SHOOT SARAH CONNOR.
      100700     END-PERFORM.
      100800 MAIN-LOGIC-EXIT.
      100900     EXIT.

      --
      In Soviet Russia, Jesus asks: "What Would You Do?"
    2. Re:Cobol defeated da Terminator by AKAImBatman · · Score: 4, Informative

      The 2600 only has TWO sprites. The missiles and the ball are 1-bit graphics and thus aren't really counted as "sprites". So there are 5 movable objects. Then there's the playfield. The playfield plots rather long lines (4 pixels per bit IIRC?) at fixed locations. Of course, there wasn't enough memory to store an extra 20 bits to fill the screen. That would be too easy. Instead, the [i]same bits[/i] were reused to draw the second half of the scanline. You could have the playfield repeat or you could have it mirror the bits. But if you wanted to actually have a full-width playfield, you had to "race the beam".

      And by "race the beam" I mean that you would time the processor cycles just right so that you would replace the bits in the registers immediately after they were written to the screen. Since you were working with only 2 1/2 bytes, and you could only write a full byte, that became somewhat challenging. Especially since the 6507 CPU was clocked at 1/3 the speed of the TIA chip. For every three pixels plotted, you'd get one CPU cycle. To add insult to injury, even the shortest instruction still used 2 CPU cycles. And God help you if you crossed a page boundary while reading or writing memory. The extra cycle you incurred would be enough to throw off the entire program and cause nothing but garbage to get written to the screen!

      Making things even more difficult was the way you moved sprites around. There was no way to say "show this sprite at location X". Instead, you had to use one scanline to mark the approximate pixel location of the sprite (remember, 3 cycles per CPU clock), then use the location counter function to advance the position forward or retard it backward by a few pixels. And by a few, I mean 0-3.

      As a result, you had to become a master at timing everything. You counted the cycles, you watched the memory locations, and you figured out how to beat the machine at its own game. Which (oddly enough) is more or less how the system was designed to be used. By the end of the 2600's lifetime, developers had pulled incredible graphics out of the system. Some were done with the assistance of special cart hardware, but most of it was simply the ingenuity of the developers.

  2. Re:Why is Cobol hated? by nawcom · · Score: 5, Informative

    Can someone give me a side-by-side example of C and Cobol program or statement to do the same thing which would illustrate why Cobol is so "evil"?

    C (No bells or whistles): http://99-bottles-of-beer.net/language-c-116.html

    COBOL (or as I call it, COBALD): http://99-bottles-of-beer.net/language-cobol-1820.html

  3. Re:Wasn't BASIC by VGPowerlord · · Score: 4, Informative

    No, I just switched his COBOL quote out for the BASIC one on my whiteboard at work on Monday.

    The BASIC one is

    It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

    See: Wikiquote

    --
    GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011