Don't Count Cobol Out 274
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."
Cobol defeated da Terminator (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 [sacbee.com] and nobody can touch it.
Sounded like political bull to me, but then again...
Re:Why is Cobol hated? (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 [99-bottles-of-beer.net]
COBOL (or as I call it, COBALD): http://99-bottles-of-beer.net/language-cobol-1820.html [99-bottles-of-beer.net]
Re:Wasn't BASIC (Score:5, Informative)
No, I just switched his COBOL quote out for the BASIC one on my whiteboard at work on Monday.
The BASIC one is
See: Wikiquote [wikiquote.org]
Re:GOODBYE WORLD (Score:3, Informative)
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. HELLO-WORLD-PROG.
000030 AUTHOR. TIMOTHY R P BROWN.
000040*The standard Hello world program
000050
000060 ENVIRONMENT DIVISION.
000070
000080 DATA DIVISION.
000090 WORKING-STORAGE SECTION.
000100 01 TEXT-OUT PIC X(12) VALUE 'Hello World!'.
000110
000120 PROCEDURE DIVISION.
000130 MAIN-PARAGRAPH.
000140 DISPLAY TEXT-OUT
000150 STOP RUN.
Re:Cobol defeated da Terminator (Score:3, Informative)
Correction, Gov. Schwarzeneggar wanted to partially defer pay to California state workers, and pay them in the next quarter. That's what was impossible. And yes, that seems like it would be a lot of work, even if the language wasn't an issue, with the possibility of breaking quite high.
Re:Cobol defeated da Terminator (Score:5, Informative)
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.
Re:Cobol defeated da Terminator (Score:5, 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.
Re:Cobol defeated da Terminator (Score:3, Informative)
Yup, maybe me laugh when I saw it because I was writing 6502 assembly at the time
http://en.wikipedia.org/wiki/MOS_Technology_6502#6502_in_popular_culture [wikipedia.org]
In the science fiction movie The Terminator (1984), starring Arnold Schwarzenegger, the audience at one point is treated to a view through the T-800 Model-101 robot character's eye/camera display with some 6502 assembly/machine code program fragments scrolling down the screen. The program was listing the Apple ][ Disk Operating System (DOS) 3.3 disassembled program listing. Also shown is the output from a run of an Apple ][ checksum program called KEY PERFECT 4.0, published in Nibble magazine.
Cobol is cool :) (Score:2, Informative)