Using Perl for COBOL

petdance on 2002-09-03T22:36:36

There was a job posting that came thru my inbox today for a company I interviewed with a year or two ago. The company name rang some nasty bells in my head.

This company did some records-tracking software in a truly mission-critical industry. I applied for the job, went down and talked to their head programmer guy. He did all the software himself. It's clear it was one of those "just get the guy to write it and get it working" situations. He wrote Perl as COBOL or BASIC. No use of any Perl string-handling, for example, much less objects or any other sort of post-1980s features.

And, it was all code like this:

$a = substr( $foo, 4, 3 ); print $a, " widgets found\n"; close BAR; if ( $x == 3 ) { print "Do you want to bar?" } else { print "Do you want to wango?" } open( FOO, "<$filename" ); $q = ; # ... etc etc etc

He explained that he likes to put as much code on one line as he can so that he can see as much code as he can on the screen at one time. In Notepad, mind you.

I told him that if I came on board I could help them immensely, and that I would have to redo their entire way of doing things. He wanted a code-monkey to crank out some patches. He realized that we were not a fit. :-)

Now, this was two years ago, so I don't know what they're like now. It was easily the worst Perl I'd ever seen.


Bad Perl

vsergu on 2002-09-03T23:02:14

Good attempt, but the trophy for best bad-Perl story remains with jdporter for the moment.

Re:Bad Perl

petdance on 2002-09-04T13:57:39

OK, I'll agree with you, but only because of the "write out to a file and read it back into an array because I don't know about push()".

MJD's program repair shop

dc2000 on 2002-09-13T21:23:53

MJD's program repair shop is an oasis of such code.