Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I received so much positive feedback on COBOL vs. Perl that I figured Monks who have never worked on legacy systems may appreciate a discussion of why languages like Perl are superior to dinosaurs like COBOL.

Why is it a problem that legacy COBOL code still exists? Because in the 60s, CPU cycles and storage were tremendously more expensive than the programmer, relative to today. Thus, development was geared towards putting the burden of the work on the programmer. The computer was asked to do as little as possible, thereby ensuring that the bulk of the tedious work was handled by the relatively inexpensive programmer.

For example, COBOL (at least on IBM mainframes) can't create a new file. Instead, you have a FILE SECTION that would describe the new file. It might look like this:

FD O-NEWFILE RECORDING MODE IS F BLOCK CONTAINS 0 RECORDS RECORD CONTAINS 80 CHARACTERS LABEL RECORDS ARE STANDARD DATA RECORD IS O-NEWFILE-REC. 01 O-NEWFILE-REC PIC X(80).
That doesn't create the file. Job Control Language, or JCL, opens the file (think of JCL as a primitive scripting language). In another portion of the program, O-NEWFILE is linked to the JCL filename (well, sort of) and the JCL then attempts to create the file. The JCL that actually opens the file might be something like:
//NEWFILE DD DSN=B7707O.DDA50010.APDATA, // DISP=(NEW,CATLG,DELETE), // UNIT=DASD, // SPACE=(CYL,(150,150),RLSE), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=6400)
Note the lack of spaces. JCL is so intolerant that errant white space will cause the job to fail. Try to debug that.

After you've compiled and linked the program, you execute the JCL which will execute the COBOL program and then try to open the file. Without going through a COBOL or JCL tutorial, suffice it to say that with modern languages, such as Perl, many of the things that you had to tell a mainframe to do are handled behind the scenes. If you find the aforementioned example mind-boggling, just consider that I have greatly simplified them.

Compare that to Perl:

open (MYFILE, "> $file") || die "Couldn't open $file: $!\n";
In the modern world, where we need to get things done, Perl reigns. Perl's not always the best language for the job (try writing the setiathome screensaver in Perl), but when you need to get things done and done fast, Perl can't be beat. The dinosaurs are going to be around for a long time, but they have to die.

In reply to Perl: Survival of the Fittest by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (8)
    As of 2014-12-27 03:10 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (176 votes), past polls