News for hackers. Stuff that matters.
Re:Real Programmers Don't Use Pascal (1982) by cr0sh on Thursday March 28, 2019 @01:14PM (#19514298)
> break out of nested loops

-deeply- nested loops at that.

I once was on a thread in a forum discussing state machines, and somewhere in the convo the use of GOTO popped up. I wasn't for it, but somebody made mention of how it could be used to implement a state machine very compactly.

Then he showed his code - it was done in PBASIC. I saved a copy of that code, because it was very, very elegant. While I knew there were certain very niche cases for GOTO, I never thought that a state machine would qualify. For me, it does now.

I don't have the code handy, but it reminded me of Duff's device, if you know what that is - just done in BASIC - and not as a SWITCH-CASE of course...

There are no comments on this comment yet.