Comment by EvanAnderson
9 hours ago
I dug up to code to make sure I was remembering properly and, oh boy, I was! There's a header on the file that indicates a revision date of 2011. I wonder if the coding style isn't based on style-guidelines at the MAS 90 customization company. I'm betting they have code going back decades, and keeping a consistent style is probably a win (even if the style is eye-gougingly bad to read). I do see they've adopted a mix of numeric line numbers and alphanumeric labels.
I'm used to "ON ERR GOTO"-type error handling in BASIC dialects, whereas in this code I'm seeing a lot of defensive "IF ERR=xxx" after API calls. It looks like they're also "cleverly" using the division by zero handler as an "escape hatch" out of a subroutine. To paraphrase some their code:
> 31338 IF ERR=15 THEN LET ERRMSG$=MSG(-1) ELSE IF ERR=14 THEN GOSUB DB_LOGIN; IF NO_CONNECT THEN LET a=1/0 ELSE GOTO 31337
That's the stuff!
Apparently they didn't make use of line renumbering (or the ProvideX environment doesn't support it) because I see features and error-handling shoehorned in between lines numbered ascending by 10. It reminds me of 9 y/o me shoehorning in new code when I was trying to write text adventure games using a unique INPUT / IF/THEN / GOTO block for each "room" of the game.
No comments yet
Contribute on Hacker News ↗