Print Story OK, I Was Wrong
Working life
By wiredog (Fri Apr 03, 2009 at 02:06:16 PM EST) (all tags)
His code is that bad.


A couple hours debugging leads, eventually, to a line of code that (I think) should never have worked which, surprise, doesn't work.

Casting CheckedListBox.Item as a DataRowView as a DataTable. Apparently the first cast actually works. The row is saved into the CheckedListBox[i].Data value. But trying to cast the row as a table? Fail.

It seems that try/catch blocks, like comments, are for the weak. So the exception bubbles up to the one try/catch that catches everything, gives the user a useless error message ("Unexpected Error"), and then logs the stack dump.

OTOH, the people I work with are generally competent, the work is fairly interesting, and the commute is 1 mile.

Oh, and free lunch on Friday. Greek this week. Gyros, Pasticio (the spinach turnovers in phyllo), salad, baklava.


The best things in life are free, there ain't no such thing as a free lunch, therefore lunch is not one of the best things in life. QED.

< Basement Sushi | Ouch >
OK, I Was Wrong | 7 comments (7 topical, 0 hidden) | Trackback
My Code Is Worse by CheeseburgerBrown (2.00 / 0) #1 Fri Apr 03, 2009 at 03:09:47 PM EST
10 PRINT "CBB CANNOT CODE" 20 FOR K=1 TO 100; NEXT K 30 GOTO PUB


I am from a small, unknown country in the north called Ca-na-da.
I can fix that. by BadDoggie (2.00 / 0) #3 Fri Apr 03, 2009 at 08:02:25 PM EST
Who the fuck wants to wait 100 jiffies?

LIST
10 PRINT "CBB CANNOT CODE"
20 FOR K=1 TO 100; NEXT K
30 GOTO PUB

20

LIST
10 PRINT "CBB CANNOT CODE"
30 GOTO PUB

RUN


CBB CANNOT CODE
ERROR -- UNDEFINED LINE 'PUB'

READY


After that I really need a drink. It's your round. I would've been buying but you used an undefined GOTO instead of a GOSUB.

woof.

OMG WE'RE FUCKED! -- duxup ?

[ Parent ]
It's frightening by wiredog (2.00 / 0) #4 Sat Apr 04, 2009 at 09:45:33 AM EST
that you could recognize the error. It's been a couple decades since I've done BASIC. I'd completely forgotten about GOSUB.

Earth First!
(We can strip mine the rest later.)

[ Parent ]
I can do it in a single line of AtariBasic by BadDoggie (4.00 / 1) #5 Sat Apr 04, 2009 at 10:12:51 AM EST
Two if I have to avoid the GOTO.

1 F.K=1TO100;?"CBB CANNOT CODE";N.K;PUB=2;DIM $PUB 15;$PUB="Crown & Lion";GOS.$PUB;END
2 ?"Time to head to ",$PUB,".";I.$USER="CBB"?"; It's your round";RET.

IIRC, between line and text concatenations, the abbreviations and such, this tokenises to around 300b in Atari 8-bit. I'd have to check the BASIC source code to be sure.

Tune in next week when I try to do this in ASM. Or MAC65. You want /|\ 6502, you've come to the right place. Anything's better than programming in SNOBOL or PL1.

woof.

OMG WE'RE FUCKED! -- duxup ?

[ Parent ]
you took our advice at k5 seriously by Nigga (1.33 / 3) #2 Fri Apr 03, 2009 at 05:21:20 PM EST
you know the one where we kept saying

HuSi --------------> 

thanks for that.



perhaps Yoda wrote that code by dev trash (2.00 / 0) #6 Sat Apr 04, 2009 at 02:10:23 PM EST
There is no try, only do.


--
Click
Yoda was competent. by wiredog (2.00 / 0) #7 Sun Apr 05, 2009 at 02:19:38 PM EST


Earth First!
(We can strip mine the rest later.)

[ Parent ]
OK, I Was Wrong | 7 comments (7 topical, 0 hidden) | Trackback