5 ms·
The most widely used version of Basic which these platforms used does not have functions. This makes Basic programs tend to spaghetti and unreadable code, espec
by teddyh 4y ago
The most widely used version of Basic which these platforms used does not have functions. This makes Basic programs tend to spaghetti and unreadable code, especially considering the constant memory constraints of those platforms. I grew up on these systems, and every time I think back on it I wish something like Forth would have taken its place – i.e. something with a clean and scalable pattern for abstraction. Basic, on the other hand, doesn't do abstractions. It barely has data types and what it calls “functions” are an even more limited form of Python's style of lambdas; every subset of code which can actually do something looks like “GOSUB 11600” when you call it. No naming, no abstractions, nothing. (No parameters or return values, only global variables.)
(This is in some ways even worse than assembler, which usually has labeled goto’s.)
When I programmed in Basic those many years ago, I was stalled when my programs reached a certain level of complexity. I was then mostly halted in my education and development as a programmer for many years, because the language did not make program composition easy. It was not until I had the opportunity to learn other languages with did have proper functions and other methods of program composition that I could break through the barrier, so to speak.
(Reportedly, BBC Basic on the BBC Micro did have proper named functions, and later versions of Basic like on the Atari ST and Amiga also had them. I believe that those versions of Basic would have been vastly more productive and taught people the usefulness of abstracting things as you go, building ever higher abstractions, etc. But this is never the version of Basic which people talk about, or used by all those listings in magazines, etc. These are, for all intents and purposes, not the “80s style Basic” which everybody remembers with such apparent and baffling fondness.)
(Mostly a repost of previous posts of mine, e.g. https://news.ycombinator.com/item?id=25014279 https://news.ycombinator.com/item?id=25014279)
- Mountain_Skies 4y agoMany BASICs of that era were limited to two significant characters for variable names, which made the code even less readable. There were some attempts at creating preprocessors that would take more readable code and turn it into something the interpreter could use, but at that point, you might as well go all the way with using a compiled language.
- musicale 4y agoDartmouth BASIC was compiled yet still had limited variable names for simplicity.
- WalterBright 4y agoMy game Empire started in BASIC, and was then ported to FORTRAN. You can still see the BASIC legacy in the code in the variable names like "Z6".
- beej71 4y ago"My game Empire", he says offhandedly. :) Thanks for that--I fired it up about a year ago. Still fun!
- WalterBright 4y agoI keep thinking I should upgrade its primitive neural network computer strategy with a modern one. I bet it would kick ass!
- WalterBright 4y agoBASIC is a fine language as long as it fits on one screen (24 lines). No abstractions are needed for such short programs.
- greenbit 4y agoIt's not just language abstractions or lack thereof, there was a really fundamental issue, that makes what you say true - at least if we're talking about line-numbered BASICs. None of those early ones had a proper editor. It struck me sometime after leaving BASIC, that the whole line-numbering thing was really kind of a cheesy substitute for proper text editing. Given the limitations of the day, though, it was adequate. But relating to your point, once your program grew beyond a screen-full, you were stuck typing things like "LIST 300-399" several times a minute, just to look through your code. Today we just page-up/page-down w/o thinking, it doesn't break the flow just to navigate through a program, but in 1980, those line numbers were In Your Face! For programs that fit on one screen, though, this wasn't such an issue. With something like the PET, you could even cursor around on the screen and change things almost like using Notepad.
- WalterBright 4y agoBASIC also had to work with hardcopy terminals, like an ASR-33. Screen editors were way in the future!
- ChicagoDave 4y agoThis is simply not true. The Basic compiler on DEC PDP’s had Function and Sub and modules you could swap in and out of memory as needed. PDP usage was huge in the 80’s. And Microsoft BASIC 7.1 was a full native compiler with the same language syntax. The line number versions of BASIC were used for amateur code, but professional systems had full procedural syntax.
- teddyh 4y agoNormal people, which are the subject of the article, did not have DEC PDPs. Did any commonly used home computers of the time have Microsoft Basic 7.1?
- ChicagoDave 4y agoThere were far more people writing code on PDP's in companies than people writing BASIC on PC's at home in the 80's. You may not have known about it, but almost every college had one and there were hundreds of thousands of businesses that ran on PDP BASIC.
- teddyh 4y agoThose people are not what the article is about, though. The article is about kids, encountering Basic at home.
- mysterydip 4y agoI know the article is about 80s BASICs, but QBASIC, first available in 91 and included free in MS-DOS 5.0 and higher, had named functions and subroutines.
- teddyh 4y agoYes, and? Almost all later Basic implementations has those. As I wrote, even some 1980’s Basic implementations had them. But those were not the Basic implementations used by people who owned the popular home computers in the 1980s. And, as a result, it is not what people commonly think of as “Basic”. I feel I am repeating myself here.
- shever73 4y agoEveryone’s experience is different I guess. I started on Sinclair BASIC, which had no functions (apart from a mathematical DEF FN). The limitations of the language in terms of maximum complexity and speed prompted me to learn Z80 machine language, which also does not have named functions. I didn’t find this lack of abstraction a hindrance. It actually helped when I moved on to C on a PC. So I don’t find the fondness for the limited 80s BASIC baffling at all.
- FabHK 4y agoYou allude to it, but I want to highlight an exception: GfA BASIC, widely used on the Atari ST in the late 1980’s, and later also available on Windows (with a compiler, even), didn’t suffer most of the limitations you mention. It was a great and modern (for the time) language. See the screenshot on Wikipedia for an impression: https://en.wikipedia.org/wiki/GFA_BASIC https://en.wikipedia.org/wiki/GFA_BASIC
- PaulHoule 4y agoWhen I was coding on a TRS-80 Color Computer I was read a book that had type in source code for a preprocessor for the IBM PC that would let your write BASIC without line numbers and use control structures like WHILE loops instead of GOTO. You would edit code with a text editor and transform it into a program you run with the normal interpreter. I rewrote it for the CoCo which was not very hard because the syntax of BASIC is simple enough that you don’t really need to understand how compilers work to make something like that.
- lll-o-lll 4y agoNot going to argue with your points, except to say that I think it was good and useful for a primary school aged level of understanding. You could learn the entire language, every keyword, by heart. You could get to grips with all the various basic logic flows (if then else, while), understand variables, and you could get instant feedback (essential for the young kid). Scratch provides that learning place now, but basic was good for that first step into programming. Fully agree that it was easy to outgrow it (at least until things like quickbasic came along).