• (cs)

    Aww, poor Reggie :(

    It would have been a better idea to move the error-handling code into some common library/module though, innit? Manual search-and-replace can't be good.

  • ShelteredCoder (unregistered)

    I love the name. I wonder how many will "Get it"

  • (cs)

    And this, friends, is why we have code reviews... (at the very least, on a sample of the changed programs).

  • 0x15e (unregistered)
    At the time, it seemed like a good idea.
    Ah yes ... such a simple phrase always seems to have such serious ramifications.
  • keko (unregistered)

    Regular expressions? A cutting edgy technology in the Cobol days?

  • yummy (unregistered) in reply to ShelteredCoder
    ShelteredCoder:
    I love the name. I wonder how many will "Get it"
    I don't ... please explain.
  • SomeCoder (unregistered)

    I'm guessing the WTF is the fact that they didn't use an automated process for this, or the fact that they didn't have code reviews. Unless I'm missing details, seems like some grepping would work wonders for this problem.

    Reggie really can't be blamed for this one because he didn't claim to be a programmer.

  • (cs) in reply to yummy
    yummy:
    ShelteredCoder:
    I love the name. I wonder how many will "Get it"
    I don't ... please explain.

    you are either sarcastic or naive.

    reggie x preston = regular expression

  • Aaron (unregistered)

    So is the name an ironic description of his abilities, or was there never any contractor and the name is a metaphor for how the problem was actually solved?

  • RON (unregistered)

    Not a WTF. Oversights happen. "To err is human", yadda yadda.

    FYI: A regex probably would have messed up even worse since you cannot be absolutely certain that there's no false positives in all that code.

    Know whaddimean, vern?

  • (cs) in reply to ShelteredCoder
    ShelteredCoder:
    I love the name. I wonder how many will "Get it"

    Y'know, it didn't actually 'click' with me until I read your comment and I realized there was something there to 'get'. Then as soon as I realized it I was rolling on the floor.

  • Jimmy (unregistered) in reply to RON
    RON:
    Not a WTF. Oversights happen. "To err is human", yadda yadda.

    FYI: A regex probably would have messed up even worse since you cannot be absolutely certain that there's no false positives in all that code.

    Know whaddimean, vern?

    Agreed. Regular expressions are awesome, but with a large set of files (20k) it's almost a guarantee that there will be cases which simply don't match the pattern, unless everything was copied and pasted.

  • Dax (unregistered)

    Yawn...

  • GettingJaded (unregistered)

    Heh. Nice one, Alex. I caught the word play second time I saw that. ("Hey, doesn't that sound like...")

  • Ed (unregistered) in reply to SomeCoder
    SomeCoder:
    I'm guessing the WTF is the fact that they didn't use an automated process for this, or the fact that they didn't have code reviews. Unless I'm missing details, seems like some grepping would work wonders for this problem.

    Reggie really can't be blamed for this one because he didn't claim to be a programmer.

    Code review? Come on, that still gets you the problem with that Mumps WTF where they store all the code in a global. The guy who said it was the way to go is the guy reviewing your code.

  • Publius (unregistered)

    I assumed that Reggie X. Preston was an allegorical figure representing a regex. I guess everyone else here being programmers assume the literal meaning of everything.

  • RON (unregistered) in reply to Publius
    Publius:
    I assumed that Reggie X. Preston was an allegorical figure representing a regex. I guess everyone else here being programmers assume the literal meaning of everything.

    If it was a regex, then why did it take months to do the work?

    I assumed that the name is the authors "clever" hint that he thinks the person was entirely unnecessary and the job should have been done by a regex instead, which I've already said is somewhat foolhardy.

  • Zygo (unregistered)

    I used to work on that kind of system.

    Kids these days have it easy. Kids these days can just use a quick Perl script to hack up all those batch files. Heck, the kids are probably using code libraries and subroutines so the error-handling code is all in one place. But even when there's no Perl and people aren't using subroutines, on modern systems you can just write a simple program to do the work, then run the program.

    Imagine the horror if you're working on a system where "the set of files you can read and modify with a program that you wrote" and "the set of files that can be executed as batch files" are disjoint. A lot of pre-Unix systems have this "feature," which pretty much means you have to work for the computer vendor to write any kind of compiler for the machine.

    My solution to this problem involved driving the system's text editor from macros running in a terminal program on a PC.

    I've since been told that this is cheating--I was supposed to bribe the tape operators to accidentally mislabel a "programs" tape "data", then bribe them twice more to load the data onto a "data" volume and then some time later back up the "data" volume and restore it as a "programs" volume.

    It turns out that three rounds of beers each time this is required was actually cheaper than the per-character charges for interactive access my department was paying for the terminal macros (at $0.80/kilobyte even $8 beers are cheap). Oops. Live and learn...

  • Proud COBOL Programmer (unregistered)

    I had a different problem - how to make them STOP running a program when a problem appeared. The solution was simple - open the executable as a data file and rewrite the first record with an error message. The executable refused to run and I knew who caused the problem.

    The trick worked great in Decsystem-10 Cobol, but Vax Cobol is just too well protected for this to work today. Hence the comments in front of everything.

    *C68FD  ZAP-FILE
    *C68            VALUE OF ID IS "GRP601EXE"
    *C68            VALUE OF USER-NUMBER IS 10000,10000
    *C68            DATA RECORD IS ZAP-REC.
    *C68
    *C6801  ZAP-REC.
    *C68    03 ZAP-REC-LENGTH       PIC 999 COMP.
    *C68    03 FILLER               PIC XXX.
    *C68    03 ZAP-DIST-KEY         PIC X(6).
    *C68    03 ZAP-INI              PIC X(6).
    *C68    03 ZAP-SEM-YR-HOLD.
    *C68            05 ZAP-SCHOOL   PIC XX.
    *C68            05 FILLER       PIC X(4).
    *C68    03 ZAP-FLAG             PIC X(6).
    *C68    03 ZAP-TIME             PIC X(12).
    
    
    *C68    OPEN INPUT ZAP-FILE.
    *C68    READ ZAP-FILE
    *C68    AT END
    *C68            MOVE "00" TO ZAP-SCHOOL
    *C68            MOVE TODAY TO ZAP-TIME.
    *C68    IF ZAP-TIME IS NUMERIC
    *C68            DISPLAY "A SERIOUS FILE PROBLEM HAS BEEN DETECTED AT SCHOOL "
    *C68                    ZAP-SCHOOL
    *C68            DISPLAY "THE MARK HISTORY SYSTEM IS TEMPORARILY SHUTTING DOWN."
    *C68            CLOSE ZAP-FILE
    *C68            MOVE "E" TO RESPONSE
    *C68            GO TO 2-EXIT.
    *C68    CLOSE ZAP-FILE.
    
    999-NOTIFY-OPERATOR.
    *C68    OPEN OUTPUT ZAP-FILE.
    *C68    MOVE 42 TO ZAP-REC-LENGTH.
    *C68    MOVE DIST-ID TO ZAP-DIST-ID.
    *C68    MOVE STU-KEY-IDENTIFY-HOLD TO ZAP-SEM-YR-HOLD.
    *C68    MOVE TRAN-OPR TO ZAP-INI.
    *C68    MOVE FLAG-ZAP TO ZAP-FLAG.
    *C68    MOVE TODAY TO ZAP-TIME.
    *C68    WRITE ZAP-REC.
    *C68    CLOSE ZAP-FILE.
    
            CLOSE HISTORY-FILE POINTER-FILE.
            DISPLAY SPACES.
            DISPLAY "?          *      *  *****  *      ****".
            DISPLAY "?          *      *  *      *      *   *".
            DISPLAY "?          ********  ****   *      ****".
            DISPLAY "?          *      *  *      *      *".
            DISPLAY "?          *      *  *****  *****  *".
            DISPLAY "?          MARK HISTORY UPDATE EMERGENCY STOP".
            DISPLAY "?          CONTACT DATA SYSTEMS IMMEDIATELY".
            DISPLAY SPACES.
            IF R-INDEX NOT = 2000
                    STOP RUN.
    999-EXIT.  EXIT.
    
  • (cs) in reply to RON
    RON:
    Know whaddimean, vern?

    I miss Jim Varney. He had a lot of talent in spite of that Ernest P. Worrell routine.

  • JayTee (unregistered)

    I think the work RegX had to do is less of a WTF than the fact that their batch code was so crappy. Let's just auto-abend everything so the workers can keep working. Why not make the code work right in the first place? RegX is just a band-aid to the real WTF

  • (cs)

    If you assume that "Reggie X. Preston" stands for "regex", I find that other comment much more disturbing... How he was called in to write a spec...

  • (cs) in reply to JayTee
    JayTee:
    I think the work RegX had to do is less of a WTF than the fact that their batch code was so crappy. Let's just auto-abend everything so the workers can keep working. Why not make the code work right in the first place? RegX is just a band-aid to the *real* WTF

    Please can I have a sample of your magic code that can automatically fix problems outside of the programs control so it never needs to abort?

    Thanks in advance.

  • anonymous (unregistered) in reply to Zygo
    Zygo:
    Imagine the horror if you're working on a system where "the set of files you can read and modify with a program that you wrote" and "the set of files that can be executed as batch files" are disjoint. A lot of pre-Unix systems have this "feature," which pretty much means you have to work for the computer vendor to write any kind of compiler for the machine.

    Interesting, but my take is that still using a pre-Unix system in 2007 is a WTF. As painful as people claim porting is, it's always better than that never-ending pain. (At least port to a modern OS if you have too much code to switch languages.) I sure hope this article is from some retiring programmer's memoirs of the glory days...

  • Coyne (unregistered) in reply to brianpkennedy
    brianpkennedy:
    reggie x preston = regular expression

    It's even better than that:

    reggie x preston = Regular expression: Presto.

  • (cs) in reply to keko

    COBOL is still in wide use for business applications, which is a WTF in itself.

  • JayTee (unregistered) in reply to Quinnum

    Think about it: Management makes decision:

    When a fatal error would occur in a batch program, a message would be sent to the operator’s console that notified him of the error and prompted him to terminate the program. From there, the operator would call the program’s support contact (generally a programmer) and ask him what to do.
    Programmer allows batch to tie up the system until something is done by the programmer Programmer starts getting calls at 2am Programmer 'fixes' program by restarting it 'automagically' Programmer can sleep at night

    While at first it would appear that the 'fix' was great, it would seem to me that the "countless" phone calls described in the WTF would indicate that the issue was with the programs themselves rather than the users' issues.

    Contrary to what we'd like, we exist for our users.

    tron:
    Sark: What kind of program is he? MCP: He's not any kind of program, Sark. He's a user. Sark: A user?! MCP: What's the matter, Sark? You look nervous. Sark: Users... well, I mean... users wrote us. A user even wrote you! MCP: No one user wrote me! I was millions of their man-years!

    We, as programmers, are lazy - so we do things like prevent users from typing stupid things into our programs. Why?

    To keep the system from breaking? maybe To avoid handling support calls? Absolutely

  • (cs)

    Interesting. Recently I started learning COBOL in preparation for a potential conversion/rewrite side project. Coming from a strong C background, the verbosity is a bit much. If I were a programmer back in the glory days of COBOL I surely would have been a serial killer.

  • Rick (unregistered) in reply to brianpkennedy
    brianpkennedy:
    yummy:
    ShelteredCoder:
    I love the name. I wonder how many will "Get it"
    I don't ... please explain.

    you are either sarcastic or naive.

    reggie x preston = regular expression

    Now I wish you hand't explained (don't feel bad, I never really wanted to know in the first place). As I don't speak with a lisp, I also failed to "get it".

  • standgale (unregistered) in reply to RON

    I thought the point was that the person behaved LIKE a regular expression, thus his name stemmed from this similarity. However, as said, using a regular expression would be fool-hardy. And indeed, here are the consequences.

  • standgale (unregistered) in reply to RON
    RON:
    Publius:
    I assumed that Reggie X. Preston was an allegorical figure representing a regex. I guess everyone else here being programmers assume the literal meaning of everything.

    If it was a regex, then why did it take months to do the work?

    I assumed that the name is the authors "clever" hint that he thinks the person was entirely unnecessary and the job should have been done by a regex instead, which I've already said is somewhat foolhardy.

    Yeah, and this is what I meant to quote, not simply reply to.

  • Wildpeaks (unregistered) in reply to AssimilatedByBorg
    AssimilatedByBorg:
    And this, friends, is why we have code reviews... (at the very least, on a sample of the changed programs).
    Ad this is why we hire competent people AND don't give them tasks different from what they are meant to do.
  • bd (unregistered) in reply to Wildpeaks

    If you hire a competent person for this, he'll get bored after first 100 fixed programs. Incompetents (like our dear regexp, who didn't understand the code he was fixing) slog through, as they find it a challenge. Of course, the quality suffers without supervision.

    Nowadays, though, a competent person would whip out a script to do the job after getting bored.

  • SQB (unregistered)

    And this, friends, is why we must be very careful when using Regular Expressions.

  • Tragomaskhalos (unregistered)

    At the risk of being one of those boring commenters who states the bleeding obvious wrt the "right way", the obvious solution is: 1/ Use a script + regexes to bulk-modify the code automatically, and THEN 2/ Use a difference tool to manually verify the before-and-after states of the files, at least to a reasonable comfort point.

  • (cs) in reply to Tragomaskhalos
    Tragomaskhalos:
    At the risk of being one of those boring commenters who states the bleeding obvious wrt the "right way", the obvious solution is: 1/ Use a script + regexes to bulk-modify the code automatically, and THEN 2/ Use a difference tool to manually verify the before-and-after states of the files, at least to a reasonable comfort point.
    And the prize goes to...Tragomaskhalos! Thank you.

    To everyone who said: There might be false positives with a RegEx sounds like someone who doesn't drive because some people speed. If every batch file uses this old system, then you 1.) Make a back up of all the files. 2.) automate the change 3.) review the changed portions; files that had no change should be checked as well as a quick review of each piece changed. 3.) Test a random sample of the files if they are too numerous and time constraints prevent testing all of them. Following these steps, you would still be done before the contractor who was apparently hired for three times as long as he was needed gets through changing them all by hand, and you don't have to worry about typos or other human error (such as "That doesn't look right, I might as well fix that while I'm here..."). Of course, if you have as many programmers as the story makes it sound like, and who are all very annoyed by all these calls, you could have all of them fix the files for which they're responsible.

  • Justin (unregistered) in reply to standgale
    standgale:
    I thought the point was that the person behaved LIKE a regular expression, thus his name stemmed from this similarity. However, as said, using a regular expression would be fool-hardy. And indeed, here are the consequences.

    I disagree. NOT using regular expressions to modify many thousands of lines of code that are supposed to be the same is foolhardy.

    On the other hand, there are a couple of things that a more seasoned programmer might have done to prevent problems:

    a) Write the regexp very carefully. Seems obvious, but I know several people who just dash them off. It's amazing how many problems you can prevent by reading what you just wrote.

    b) TEST the regexp! Use 'grep' to try out your regexp on all this code and have it dump the matching lines to a file. Then LOOK at the file and see if you see anything odd. Even with all that stuff scrolling past, the oddballs ought to jump out.

    But come ON, man. The fact that a regexp MIGHT come up with false positives means that instead of 20,000 lines of code to review, you have 2,000. And the original post says they did the intelligent thing: They wrote a new regexp to deal with that too.

    Computers are machines. They are meant to do work for us. If there is a tedious, repetitive task, the computer should do it, if at all possible. We're programmers because it's our job to figure out how to do that best. Just because it isn't likely that we'll be wildly successful on the FIRST TRY doesn't mean we shouldn't try at all.

    --J

  • (cs) in reply to Tragomaskhalos
    Tragomaskhalos:
    At the risk of being one of those boring commenters who states the bleeding obvious wrt the "right way", the obvious solution is: 1/ Use a script + regexes to bulk-modify the code automatically, and THEN 2/ Use a difference tool to manually verify the before-and-after states of the files, at least to a reasonable comfort point.
    Normally I'd have to slap you for pointing out something so obvious, but the number of people here who think doing it manually is the "right way" is just downright disturbing.
  • UnresolvedExternal (unregistered) in reply to bobday

    I just want to know where he got a wooden table big enough for 20,000 files.

    ...And the resolution would be rubbish on even a top of the line camera.

    And, even if he had managed all of that, the resulting print out would never fit in the fax machine.

    This is not a real wtf.

  • (cs) in reply to Justin
    Justin:
    But come ON, man. The fact that a regexp MIGHT come up with false positives means that instead of 20,000 lines of code to review, you have 2,000.
    Ummm... right. And how are you supposed to know *which* 2,000 positives are the false ones?
  • J (unregistered) in reply to bd
    bd:

    Nowadays, though, a competent person would whip out a script to do the job after getting bored.

    The correct way is to fix the first 100 programs to find out how long it should take you to change a program, write a script that makes it look like you are taking the same time as if you were doing it manually and then sit back and play quake for 3 months.

  • japh (unregistered) in reply to Justin

    [quote user="Justin"][quote user="standgale"] But come ON, man. The fact that a regexp MIGHT come up with false positives means that instead of 20,000 lines of code to review, you have 2,000.
    --J[/quote]

    The problem is not with the false positives - those you can indeed review.

    What will you do to review the false negatives?

  • Someone (unregistered) in reply to japh

    [quote user="japh"][quote user="Justin"][quote user="standgale"] But come ON, man. The fact that a regexp MIGHT come up with false positives means that instead of 20,000 lines of code to review, you have 2,000.
    --J[/quote]

    The problem is not with the false positives - those you can indeed review.

    What will you do to review the false negatives?[/quote]

    To say nothing of the false FILE_NOT_FOUNDs!

  • Brutal (unregistered)

    Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

  • howdy (unregistered)

    Was his real name "sed" or "perl" or "awk" or...?

  • heinson (unregistered)

    what about regexp replacements?

  • Cameron (unregistered)

    This is cobol. I believe it is space sensitive along with verbose among other annoying characteristics. The chance of a regexp having an "oops" editing cobol is a lot lower than for something like "C". Seems like the Burroughs mainframe I was a sysop for a long time ago didn't have regexps.

  • (cs)

    and this is why the cool frameworks built on the principle of MVC steal the limelight.. ok.. not exactly mvc in this case.. but u get my point..

  • Kirill (unregistered)

    Just got to read this. From a German perspective, the ABENDMOD is a funny concept. The article starts with calling people at night and "Abend" is the evening in German, so it looks like "The poor dude who's got the graveyard shift babysitting the system".

Leave a comment on “Reggie X. Preston”

Log In or post as a guest

Replying to comment #136298:

« Return to Article