4 ms·
I wrote some basic for the first time in like 25 years. Forgot how there were no local variables nor parameters to functions. Everything is a global variable an
by tokyodude 8y ago
I wrote some basic for the first time in like 25 years. Forgot how there were no local variables nor parameters to functions. Everything is a global variable and GOSUB is just GOTO with a return stack (no parameters). Also forgot depending on the BASIC that some BASICs only allowed 2 letter variables.
Those were my biggest issues trying to get back into it.
- JohnBooty 8y agoAlso forgot depending on the BASIC that some BASICs only allowed 2 letter variables. For those not familiar with these systems, the way you coped was usually by keeping a "data dictionary" on a sheet of paper. On a sheet of paper you'd have... $AA = Name of foo $AB = Selected color of baz $AC = Blah blah $AD = Length of qux etc. It wasn't TOO bad. Until you lost the damn thing, or had to work on somebody else's code and you didn't have the data dictionary. You could keep the data dictionary in the code's comments, but on systems with just a few kilobytes of RAM (ie, the systems that restricted you to 2-char identifiers) this was not always a feasible luxury. Luckily, I managed not to have to deal with this personally. All the BASIC environments I used as a kid in the 80s did not have this limitation. But I heard horror stories.
- Angostura 8y agoCouldn't you pop those in REM statements (assuming you had RAM to burn)?
- JohnBooty 8y agoYes, but the systems with two-char identifiers were also the ones with the most extreme RAM restrictions. Some commercial Apple II software was actually written in BASIC, and you could read the code. It was usually fairly liberally commented. Example code in magazines was liberally commented as well. Folks didn't seem to comment individual lines of code, but tended to "name" and sometimes describe their GOSUB (subroutine) blocks. But, Applesoft basic didn't force you to use two character variable names. Because most Apple II's on the market had a luxurious 64KB or 128KB of RAM, and none had less than 48KB. I think it was a different story on systems with 4KB or perhaps 16KB of RAM. On those systems I bet you were often squeezing out every byte. I also think some older languages (COBOL?) often had restrictions like this.
- stevekemp 8y agoYeah there are a lot of limitations, and to make it more fun the limitations were different across computers at the time. I wrote a simple BASIC interpreter recently in golang, and I'm amazed I had the patience to write "large" programs in BASIC in my youth with the limitations that were present.
- mgkimsal 8y ago> I'm amazed I had the patience to write "large" programs in BASIC in my youth with the limitations that were present. what else did you have to do with your time? :) i've had similar thoughts, but looking back, outside of gaming, the entire use of the computer, for me, was keying in programs. some were from others (in magazines/books), and some were learning to write my own. for the first few years of having one, i had no bbs connections, so... there was really nothing else to do except read books/magazines and type in programs.
- stevekemp 8y agoI guess that's true! I switched from writing in BASIC to writing in Z80 assembly after a year or two - though it has to be said that I "compiled" my program by hand, referring to the opcode table(s) at the back of the manual. My resulting programs tended to look like this: 10 FOR N=60000 TO 60000 + 20 20 READ A 30 POKE N,A 40 NEXT N 50 RANDOMIZE USR 60000 100 DATA 1,2,3,4,5,.... As you can imagine it was a tedious process. Most of my time was really spent trying to hack games for extra-lives, which I guess wasn't so unusual back in the day. Later I used the same skills to patch binaries to accept serial numbers - before I started writing real code in C, Java, Perl, etc, etc.