4 ms·
We're from the same era, but I have decent respect for BASIC. Pounding the square peg of my applications into the round hole that is BASIC. BASIC has everythin
by whartung 2y ago
We're from the same era, but I have decent respect for BASIC. Pounding the square peg of my applications into the round hole that is BASIC.
BASIC has everything assembly does. At a high level, Assembly offers GOTO and GOSUB. Obviously, you can have pointers to anything, indirect jumps, etc. but, to be honest, unless you're writing your own malloc (and it a lot of assembly cases, you're not), you're dealing with static allocations of memory for data. A pointer can be no different from an offset into an array in BASIC (or set of arrays -- array of ints, array of strings).
You can recurse with BASIC, you just need to maintain your own stack for the data (the BASIC will handle the stack for the GOSUBs, if you continue to use them). You may well maintaining your own stack in assembly (ye old Forth-ish data stack v return stack). I've seen several different compilers written in BASIC. You can have "Structures" in BASIC. PNAME$, PADDR$, PZIP$, PBDATE. Turn those all into arrays, and you have arrays of structures. With a Pointer! (P!)
It's inelegant, but so is assembly. It's too primitive to not be. Outside of macros, there's no real abstractions. At best you can offset a memory reference to get something akin to a structure, and use constants for that offset. But, in the end, unlike todays legos, you're still stuck 2, 4, and 8 pin bricks to build everything. Plus all the fun register juggling.
Assembly lets you have better identifier names. Six letters! I remember a lady who wrote much of here companies core business software in BASIC. She was particularly proud of the fact that Z9 was the universal error/status variable used in the system. Similarly, I recall my father lamenting that he could only have variables such as A, and AA, but not AAA in BASIC (since at the time, MS-BASIC only distinguished on the first 2 characters).
BASIC is high level assembly, that just so happens to have some of the best string processing, and some pretty good I/O, in the business. (Garbage collected string processing in MS-BASIC, no small feat. Who knew you had a garbage collector in that 8K BASIC?)
I was not scarred by my BASIC experience. Nor my FORTRAN (it was FORTRAN back then) experience. (Very BASIC-ish, without the as many line numbers). I was grateful to have learned FORTRAN-77 and not -66. I would not want to go back to dealing with BASIC, particularly not 8-Bit level micro BASICs of yore, not if I didn't have to. That said, one of my favorite languages was a 4GL with in built SQL, screen forms, and reporting. It was limited in many ways that BASIC is, but, boy howdy, could I pound out usable, effective software that helped the company and its people with it, which is, in the end, what this is all about most of the time anyway.
About as far as I'd want to go back is QBASIC. It's lack of line numbers, and full screen editor send it over the top. Line numbers are what they are, but the biggest problem with them, particularly in MS-BASIC, is you can't renumber sections of lines. Like, you can't renumber lines 1000-2000 to 3000-4000. So, you can't easily re-organize and move code around.
But you make do.
Beats clicking binary into the front panel.
- kazinator 2y agoI used some utility written in machine language for renumbering BASIC lines in AppleSoft BASIC (MS derivative). It would march through the linked list data structure and assign new numbers, fixing up the GOTOs and GOSUBs.
- RetroTechie 2y ago> you can't renumber sections of lines. In some BASICs you can. And where not, there's renumber utilities. Also: MSX-BASIC has the option to save a program in ASCII format (non-tokenised). Back in the day, I used that option the other way around: start writing a program in a plain text editor, using named labels only. Then as it began to take shape, add line numbers manually (replacing the labels). But yes, line numbers are ugly.