| ▲ | wk_end 7 hours ago | |||||||
It says something about what a thoughtful development environment these early BASICs were, that you could make a full simple little game like this in only 131 lines even though they're ostensibly far less powerful than modern languages. I'm not sure if you could even get an SDL window open and game loop running in 131 lines of (non-golfed) C. Never mind how compact, beginner-friendly, and just plain fun they were to use. It's been said countless times but I'll say it again - we've lost something over the years. | ||||||||
| ▲ | prmoustache 3 hours ago | parent | next [-] | |||||||
Back in the days you would buy printed magazines that contained full basic source code of programs and games and type them on your own text editor. I was a bit too young to do that but I remember watching my older brother just do that and then play games (after finding the typing errors for a while). | ||||||||
| ▲ | diegof79 4 hours ago | parent | prev | next [-] | |||||||
What we lost is simplicity across the stack. I learned to program with BASIC. It was awful. I didn’t know how awful it was until many years later. So I don’t miss the language. But something I miss is how easy it was to learn what your machine was doing. The DOS boot and config involved only two files: CONFIG.SYS and AUTOEXEC.BAT, that was it. Most programs were self-contained, so you could copy the directory to a floppy disk and run them on another machine. If you broke something, copy the files again and restart; that was it… I “broke” config and programs many times, and it was a good way to learn. | ||||||||
| ▲ | throwaway81523 3 hours ago | parent | prev | next [-] | |||||||
BASIC was higher level (or anyway, more batteries-included) than C. You could probably do this game in 131 lines of javascript straightforwardly. | ||||||||
| ▲ | ligne 5 hours ago | parent | prev | next [-] | |||||||
131 lines and about 10% of them are the title/copyright banner. Genuinely impressive in it's terseness | ||||||||
| ||||||||
| ▲ | krapp 6 hours ago | parent | prev | next [-] | |||||||
>I'm not sure if you could even get an SDL window open and game loop running in 131 lines of (non-golfed) C. The basics (window, events, renderer) can be done in about 30 lines:
I don't think you could get all of donkey.bas done in 131 lines, though. SDL3 does ship with an embedded debug font but that seems like cheating. You probably couldn't replicate the drawing code easily, it would probably need to be faked with images, and you'd need a font atlas for the text. | ||||||||
| ▲ | sltkr 6 hours ago | parent | prev | next [-] | |||||||
It was really cool! The ease of getting started was definitely one of the selling points for the “home computers” of that era (GW-BASIC ran on IBM compatible PCs instead, but the appeal of BASIC was the same). Brevity was an important feature since a lot of people obtained programs by typing them over from a magazine or recording them from the radio. And of course, there was no such thing as auto-complete (let alone AI generation). That being said, SDL isn't actually that bad either. A minimal example is about 40 lines of code [1], not counting comments and blank lines, but including lines with just a curly brace which you could easily remove if you were concerned about size. A slightly more serious implementation of Snake runs about 345 lines of code [2]. And to be fair, DONKEY.BAS is also cheating slightly on the line metric by stuffing lines full of statements, like for example:
1. https://examples.libsdl.org/SDL3/renderer/01-clear/
2. https://examples.libsdl.org/SDL3/demo/01-snake/ | ||||||||
| ▲ | tancop 7 hours ago | parent | prev | next [-] | |||||||
raylib might do it in less lines. SDL is designed as a cross platform base layer to wrap in another framework not as something you should be using directly. | ||||||||
| ||||||||
| ▲ | Joel_Mckay 6 hours ago | parent | prev [-] | |||||||
Python is the modern Basic replacement, and also has similar fundamental design trade-offs. VB6 was the peak of the OLE/Multimedia paradigm, and was functionally replaced by the web browser script sandbox. > we've lost something over the years. Indeed, Information Appliances were never general-purpose computers. Some people used to care about that sort of thing, and left civilization the GNU compilers as one of the most important intellectual artifacts of our generation. =3 | ||||||||