Why not Goto?

Blitz3D Forums/Blitz3D Beginners Area/Why not Goto?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.


I still use gosubs in my main programs, but only to move code out of the main loop which I would have in the main loop anyway.



Ditto -- I don't see Gosub as remotely evil or worrisome. Functions excel at manipulating the values you pass them and returning a result... it's what they do; The way they're now pushed so heavily as the de facto way to cordon off a subroutine is totally puzzling to me: I remember, while attempting picking up a bit of C++, the whole fandango involving void functions and pointers JUST TO MOVE A BIT OF CODE ON THE SCREEN IN ORDER TO MAKE IT MORE ORGANISED struck me as the most awkward-for-its-own-sake approach imaginable (and, if I'm honest, I mention it now largely in the hope that someone better versed in C++ will say "Sledge you pleb, you can branch easily like this instead..." as I still can't quite belive that the language is so unaccommodating). Branching isn't just done for the sake of constructing a more optimal exe, it's done in order to increase the presentability of the source code too -- Gosub is worth its weight in gold for this and should definitely not be classed alongside Goto and dismissed with it.



EDIT: Deleted accidental Paste