http://www.antonis.de/qbebooks/gwbasman/deffn.html
Otherwise, you had to fake it, which you kinda note: Since all variables were global in nature, this made it challenging - but possible. You could set aside a few named variables for your "functions", then just use GOSUB:
10 X0=1:X1=3:GOSUB 1000:PRINT Y0
.
.
.
999 END
1000 REM THE FUNCTION HERE
1010 Y0=X0+X1
1020 RETURN
That isn't "spaghetti code"; done properly, it's a form of structured BASIC. No, it isn't as readable, but you honestly get used to it. "GOSUB 2050" just means "do this task" and you know what to pass it (and if you don't, then you need to consult your docs or REM statements).It's only when you start mixing in GOTOs jumping out of routines, all over the place, no structure, etc - that's where you get the infamous spaghetti code...
Um, yes? That’s exactly what I meant by “an even more limited form of Python's style of lambdas”. Which is what they are. I never used them myself; I never, ever, found a use for them.
The rest of your argument seems to be “If you’re careful, it’s techically possible to write structured code.”, but the same can be said of most any language. Even assembly language for $FOO’s sake, usually has labels!
EDIT: Fixing comment to reflect you said 80's-style. My speedreading made me miss it first time.
> No naming, no abstractions, nothing.
This is not entirely true. BBC BASIC (certainly the versions I used on the Electron and Master 128) had both named sub-procedures and named functions, with local variables and allowing recursion. While limited in some ways they did allow programming without sight nor sound of GOTO/GOSUB, which I actually used to do.
You could even do away with line numbers with a little hackery: write your code in a text editor (View, as built-in to the Master series and which we had as an add-on to the Electron we had at home before that, was what I used), I forget how due to the mists of time but I had a method of having the file repeated as if typed from the keyboard (adding in the line numbers via AUTO) and executing it directly. I felt rather clever, particularly as I did it mainly because a CS teacher had said it was not possible!
OK, sounds great. I also remember the versions of Basic on the Amiga and Atari ST being perfectly adequate in this regard.
But this is never the version of Basic which people talk about! What you describe is not the version of Basic used by all those listings in magazines, or in the linked article. This is, for all intents and purposes, not the “80s style Basic” which everybody remembers with such apparent and baffling fondness.
However, later 80's 16-bit Basic (think Amiga, ST, QuickBasic for the PC, etc.) at least had functions, libraries, etc.
Going back to 8-bit is probably too far...
Almost, but not quite. It would ignore anything after the 40th character of a name, and the overall line length restriction (255 characters, less line number) imposed a secondary limit.
Still night-and-day compared to some common contemporary BASIC variants what only allowed two-character variable names, of course, and not much of a limitation as really long names would soon have you hitting the overall memory restriction of the default address space (between 10 and 29Kbyte available, depending on screen mode, which had to be enough for the heap (including your code) and the call stack).
I perhaps remember this far too well, given how long it is since I touched one of those machines...
I couldn't find any evidence of a 40 char limit on BASIC II... the full length of the variable name appears to be stored and compared.
Though there was also a limit (also ~256) to the line on entry, which you would normally hit first because keywords are stored tokenised: "PRINT" would be stored as one byte not five.
I agree, but this is exactly what the linked article does. It even promotes the idea that the GOTO is better than functions or OOP, because it’s “simpler”. Needless to say, I disagree.
Naming things is almost a prerequisite to be able to think and reason about things without keeping the entire program in your head at once. And without any means of abstraction with names for code, old-style 80s Basic fails this requirement.
“I liken starting one’s computing career with Unix, say as an undergraduate, to being born in East Africa. It is intolerably hot, your body is covered with lice and flies, you are malnourished and you suffer from numerous curable diseases. But, as far as young East Africans can tell, this is simply the natural condition and they live within it. By the time they find out differently, it is too late. They already think that the writing of shell scripts is a natural act.”
— Ken Pier, Xerox PARC