(c) 2005 by Lousy Coder

I copied that right out of a mainframe PDS, the tabs didn’t take. Looks like I need to learn a little more about vB coding. :smack:

Dude, ELSE NEXT SENTENCE is not standard COBOLII, and what’s wrong with EVALUATE? And you don’t need a period after that END-IF. Great heavens above, they give you these explicit scope terminators and you insist on clinging to your 1960s-style punctuation characters? And what’s with these DISPLAYs? You expect someone to dig through the SYSOUT to find the message? :rolleyes:

Better (not necessarily best):

PERFORM S100-GET-PC-THRESHOLD
EVALUATE TRUE
WHEN W100-POSTCOUNT < PC-THRESHOLD
MOVE W100-DISAGREE-TEXT TO MY-OPINION
WHEN OTHER
MOVE W100-AGREE-TEXT TO MY-OPINION
END-EVALUATE
PERFORM S200-EXPRESS-OPINION

Sheesh…

Hard to believe I get paid for writing this crap, ain’t it? :smiley:

An amusing tangent on copyright boilerplates… a few years ago my company changed its logo. An internal pamplet was sent to every employee, stressing the importance of using the new logo, effective immediately.

The pamplet had the usual notice on the back about how the company name and logo are registered trademarks, with the usual accompanying graphics.

Including, of course, the old logo.

END tangent; posts=posts+1; run;

You can’t fool all of the people all of the time, but if you can pull the wool over the right eyes twice a year, you can generally get by. :stuck_out_tongue:

No, 225 more posts are needed.

At 224, the postcount will be exactly 2000 and the program will fall through to the end without doing anything at all.

It’s working so far! :slight_smile:

At the time I posted, (hence the notation “as of this post”), his post count was 1,777.


1,777
+ 224
2,001

I really can do math and, as a [basso profundo] Professional Programmer [ /basso profundo ] I noticed (without comment) the greater than/less than logic error when I first saw it.

But Tom, I thought we Professional Programmers were supposed to talk in reedy, nerdy little voices.

Oh, by the way …

No fair pointing other people’s mistakes without exposing them to your own:




	movea.l  OPinfo.l, a2
	move.l   Pcount(a2), d1
	cmpi.l   #2000, d1
	bls      NoAgree
	
	movea.l  ScreenBuf.l, a1
	move.b   #49h, (a1)+
	move.b   #20h, (a1)+
	move.b   #61h, (a1)+
	move.b   #67h, (a1)+
	move.b   #72h, (a1)+
	move.b   #65h, (a1)+
	move.b   #65h, (a1)+
	move.b   #21h, (a1)+
	move.b   #21h, (a1)+
	move.b   #21h, (a1)+
	bra.s	   DoNothing

NoAgree:
	beq         DoNothing
	
	movea.l  ScreenBuf.l, a1
	move.b   #54h, (a1)+
	move.b   #68h, (a1)+
	move.b   #69h, (a1)+
	move.b   #73h, (a1)+
	move.b   #20h, (a1)+
	move.b   #74h, (a1)+
	move.b   #68h, (a1)+
	move.b   #72h, (a1)+
	move.b   #65h, (a1)+
	move.b   #61h, (a1)+
	move.b   #64h, (a1)+
	move.b   #20h, (a1)+
	move.b   #69h, (a1)+
	move.b   #73h, (a1)+
	move.b   #20h, (a1)+
	move.b   #73h, (a1)+
	move.b   #74h, (a1)+
	move.b   #75h, (a1)+
	move.b   #70h, (a1)+
	move.b   #69h, (a1)+
	move.b   #64h, (a1)+
	move.b   #21h, (a1)+
	move.b   #21h, (a1)+
	move.b   #21h, (a1)+
	
DoNothing:
	nop



Ok, I was doing fine for a while but then y’all geeked it up too much for even me.

-neuroman, B.S.C.S.

I remember the old George Carlin saying, “Did you ever notice that when you’re on the freeway, everyone driving faster than you is an idiot, and everyone driving slower is a moron?”

There’s a corollary to programming here: Every other programmer in the world writes crap code, whereas I, in 20 years of programming, have never written a line of bad code.

I think we’ve all got code lurking around that could use a little tuning up.

Gotta agree about the copyright, anyway. It’s especially hilarious on a web page with 30 bloody lines of pedestrian Javascript.

Actually the line I use on people when code reviewing is “if I had a dollar for every missing semi-colon I’ve ever found in somebody else’s code… but had to pay a dollar for each one somebody else found missing in mine… I don’t know whether I’d be rich or poor, but man, the turnover I’d have!” :slight_smile:

Og this sounds horrible in English :frowning: But you get the idea

You guys write such easy-to-read code :slight_smile:


$_ = sub {shift()<2000 and print shift or shift and print shift;}; 
&$_($postcount,"This thread is stupid!
","I agree!
");

Re the OP, here’s something I sometimes find:


// The speed of the vehicle
int vehicleSpeed;


WTF?

It’s been a VERY long time… but:

EVALUATE POST-COUNT
WHEN < 2000
PERFORM W100-STUPID
WHEN OTHER
PERFORM W200-AGREE
END-EVALUATE

would this be a little bit shorter??? :smiley:
Yeah, you’d still have to code the relevant sections and all… but I think my lines have less characters than yours… :wink:

I’d post another version, but hexadecimal on punch tape doesn’t work well these days.

Class Post …
Class StupidPost Inherits Post …
Class GoodPost Inherits Post …
Class Member
ArrayList posts …
Class Message …

try {

If (posts.size<2000) {
member.posts.add(new StupidPost(currentPost));
return Message.StupidPostMessage;

} else if (posts.size>2000) {
member.posts.add(new GoodPost(currentPost));
return Message.GoodPostMessage;
}

catch (MemberStatusException pde) {
postConnection.close();
return Message.MemberStatusExceptionMessage;
}

catch (Exception e) {
System.out.println(e);
}

Rpg:

Count Sub 2000 Test 30 31 32
30 Move ‘stupid’ Msg
31 Move ‘good’ Msg

That’s only for MS and Java geeks. Mainframers have to be able to cow CIOs and CEOs (and ::: gasp ::: billing clerks), so we talk a lot more like John Wayne.

So, if they ever convert me from a mainframe dinosaur into a Java geek, my voice will change? Another reason to hang around to turn out the lights.