Comment On Reggie X. Preston

At the time, it seemed like a good idea. 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. Management figured that someone with some knowledge of the program should be the one that decides, not just some operator. [expand full text]
« PrevPage 1Next »

Re: Reggie X. Preston

2007-05-14 13:43 • by SpComb
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.

Re: Reggie X. Preston

2007-05-14 13:51 • by ShelteredCoder (unregistered)
I love the name. I wonder how many will "Get it"

Re: Reggie X. Preston

2007-05-14 13:53 • by AssimilatedByBorg
And this, friends, is why we have code reviews... (at the very least, on a sample of the changed programs).

Re: Reggie X. Preston

2007-05-14 14:02 • by 0x15e (unregistered)
At the time, it seemed like a good idea.
Ah yes ... such a simple phrase always seems to have such serious ramifications.

Re: Reggie X. Preston

2007-05-14 14:03 • by keko (unregistered)
Regular expressions? A cutting edgy technology in the Cobol days?

Re: Reggie X. Preston

2007-05-14 14:05 • by yummy (unregistered)
136305 in reply to 136298
ShelteredCoder:
I love the name. I wonder how many will "Get it"
I don't ... please explain.

Re: Reggie X. Preston

2007-05-14 14:10 • by 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.

Re: Reggie X. Preston

2007-05-14 14:20 • by brianpkennedy
136310 in reply to 136305
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

Re: Reggie X. Preston

2007-05-14 14:20 • by 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?

Re: Reggie X. Preston

2007-05-14 14:25 • by 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?

Re: Reggie X. Preston

2007-05-14 14:47 • by webhamster
136317 in reply to 136298
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.

Re: Reggie X. Preston

2007-05-14 15:01 • by Jimmy (unregistered)
136319 in reply to 136312
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.

Re: Reggie X. Preston

2007-05-14 15:02 • by Dax (unregistered)
Yawn...

Re: Reggie X. Preston

2007-05-14 15:03 • by GettingJaded (unregistered)
Heh. Nice one, Alex. I caught the word play second time I saw that. ("Hey, doesn't that sound like...")

Re: Reggie X. Preston

2007-05-14 15:26 • by Ed (unregistered)
136325 in reply to 136307
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.

Re: Reggie X. Preston

2007-05-14 15:35 • by 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.

Re: Reggie X. Preston

2007-05-14 15:58 • by RON (unregistered)
136333 in reply to 136326
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.

Re: Reggie X. Preston

2007-05-14 16:03 • by 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...

Re: Reggie X. Preston

2007-05-14 16:07 • by 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.

Re: Reggie X. Preston

2007-05-14 17:47 • by FredSaw
136342 in reply to 136312
RON:
Know whaddimean, vern?


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

Re: Reggie X. Preston

2007-05-14 18:16 • by 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

Re: Reggie X. Preston

2007-05-14 18:55 • by PSWorx
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...

Re: Reggie X. Preston

2007-05-14 18:57 • by Quinnum
136351 in reply to 136347
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.

Re: Reggie X. Preston

2007-05-14 19:07 • by anonymous (unregistered)
136352 in reply to 136336
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...

Re: Reggie X. Preston

2007-05-14 19:28 • by Coyne (unregistered)
136354 in reply to 136310
brianpkennedy:
reggie x preston = regular expression


It's even better than that:

reggie x preston = Regular expression: Presto.

Re: Reggie X. Preston

2007-05-14 21:29 • by groovy2shoes
136359 in reply to 136304
COBOL is still in wide use for business applications, which is a WTF in itself.

Re: Reggie X. Preston

2007-05-14 21:41 • by JayTee (unregistered)
136361 in reply to 136351
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

Re: Reggie X. Preston

2007-05-14 21:44 • by luke727
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.

Re: Reggie X. Preston

2007-05-14 22:26 • by Rick (unregistered)
136364 in reply to 136310
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".

Re: Reggie X. Preston

2007-05-14 23:29 • by standgale (unregistered)
136365 in reply to 136333
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.

Re: Reggie X. Preston

2007-05-14 23:30 • by standgale (unregistered)
136366 in reply to 136333
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.

Re: Reggie X. Preston

2007-05-15 03:12 • by Wildpeaks (unregistered)
136371 in reply to 136300
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.

Re: Reggie X. Preston

2007-05-15 03:44 • by bd (unregistered)
136373 in reply to 136371
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.

Re: Reggie X. Preston

2007-05-15 03:52 • by SQB (unregistered)
And this, friends, is why we must be very careful when using Regular Expressions.

Re: Reggie X. Preston

2007-05-15 05:44 • by 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.

Finally

2007-05-15 08:08 • by vertagano
136384 in reply to 136379
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.

Re: Reggie X. Preston

2007-05-15 08:33 • by Justin (unregistered)
136387 in reply to 136365
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

Re: Reggie X. Preston

2007-05-15 08:36 • by bobday
136388 in reply to 136379
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.

Re: Reggie X. Preston

2007-05-15 08:51 • by UnresolvedExternal (unregistered)
136389 in reply to 136388
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.

Re: Reggie X. Preston

2007-05-15 11:36 • by Zylon
136425 in reply to 136387
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?

Re: Reggie X. Preston

2007-05-15 11:37 • by J (unregistered)
136426 in reply to 136373
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.

Re: Reggie X. Preston

2007-05-15 12:19 • by japh (unregistered)
136435 in reply to 136387
[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?

Re: Reggie X. Preston

2007-05-15 12:37 • by Someone (unregistered)
136444 in reply to 136435
[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!

Re: Reggie X. Preston

2007-05-15 12:53 • by Brutal (unregistered)
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.

Re: Reggie X. Preston

2007-05-15 13:26 • by howdy (unregistered)
Was his real name "sed" or "perl" or "awk" or...?

Re: Reggie X. Preston

2007-05-16 06:51 • by heinson (unregistered)
what about regexp replacements?

Re: Reggie X. Preston

2007-05-17 17:43 • by 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.

Re: Reggie X. Preston

2007-05-20 07:32 • by rohanprabhu
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..
« PrevPage 1Next »

Add Comment