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

comment on

( [id://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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-19 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found