Live data from Hacker News

30 years later, QBasic is still the best

nicolasbize.com

111–120 of 308 posts

Re: 30 years later, QBasic is still the best

#111

For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are very concrete and have limited abstraction ability. With Basic and goto, a program is more concrete (you run a line which is more or less 1 command) and linear (no nested structures). With structured programming, it is more abstract, and has an recursive structu…

QBasic was one of my first languages I learned (as a young child), and I am fairly certain I rarely used goto, since the language does have if/for/do/while. Interpreting these structures is still fairly linear, since each part manipulates some variables, and possibly jumps to one of the delimiters (if to end, do from loop, etc.)

The language even has some structured procedure/function definitions, though I didn't grasp these until much later. In contrast to control flow, which has lexical structure, procedure invocation has dynamic structure. This exceeded my abstraction ability at the time.

Probably the most important parts about QBasic were 1) it was easily accessible in C:\Windows\System32\qbasic.exe, 2) the interface was streamlined enough that I just had to hit F5, no need to figure out tooling, REPL-like, and 3) it gave an easy interface for drawing things on the screen, which is captivating.

(And as an aside: in no way did I end up with the brain damage Dijkstra would have predicted. Unless programming in Haskell and Lisp are symptomatic -- or maybe antidote?)

By the way, did anyone else use Klik N Play or The Games Factory (both by Clickteam)? I got a lot of milage out of them. They are essentially event-driven graphical programming languages for designing on-the-simpler-end games. I wouldn't have traded them for Scratch.

Re: 30 years later, QBasic is still the best

#112

For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are very concrete and have limited abstraction ability. With Basic and goto, a program is more concrete (you run a line which is more or less 1 command) and linear (no nested structures). With structured programming, it is more abstract, and has an recursive structu…

I think you might be onto something. For my oldest son I tried to help him along in python. Just poking about in the interpreter went great, but pygame overwhelmed him and when his laptop died he never picked-up again where he left-off.

For my youngest son I introduced him to awk first. In an editor he would edit the script and then run it in the terminal. I explained how every line goes in order. At first his script would output things like:

jake is awesome I love POTATO

but soon he was using $n, variables, arrays, and conditionals from one line to the next. I had some silly stuff I had already written for awk to make it work one keypress at a time and I created a little h -> awk project for him. Then he wrote a game:

https://github.com/msliczniak/jake/tree/master/games/letters

Just yesterday he said he wants to make it so that after every 100 points more enemies show-up.

A nice benefit to this is it is a whole lot like JS. That's the way to show-off for friends, I'm still mulling how to get him there though without over complexity. I'd appreciate advice.

Re: 30 years later, QBasic is still the best

#113

Earlier quoted context omitted.

Is it simple to draw a line in JS? Like in one line of simple and straight code, yes? I mean, not adding some divs to some DOM, but actually drawing a line or circle. Drawing is simplifying things for kids.

var drawing = document.createElement('canvas'); document.body.appendChild(drawing); var ctx = drawing.getContext('2d'); ctx.beginPath(); ctx.moveTo(0, 0); ctx.lineTo(100, 100); ctx.stroke(); There's a bit of ceremony in setting up the canvas, but yes, it's simple.

1) Ok, in firefox I opened the console window. 29 buttons. The one to type this in was the thing at the very bottom that looked like ">> " with no cursor in it indicating that you could type in it.

2) typing your code (on this page) ... nothing happens. Element was added at the bottom of a very large page, element was not visible, so I didn't see anything happen.

3) the added element is a white box on a white background. Grand total indication of it getting added was a small adjustment in the (hidden by default) scrollbar on the right of the page ...

4) after that you want to start people out with paths and stroking and state storing and evaluating ?

Making a program like this that responds to keyboard input at all in javascript is dozens of lines, and you have to know DOM, properties, and event handlers in addition to the base language to make anything happen. Getting keyboard handling good enough to have a simple game ... let's not go there. Hundreds of lines. And of course, doesn't work on your friends machine (different browser ...).

I hope you can see that this is less than optimal to get people exited.

I am one of those guys that thinks web programming sucks, that it's far inferior for most programs as compared to Qt/QML and even to Delphi/VB like languages.

Re: 30 years later, QBasic is still the best

#114
post #93

Earlier quoted context omitted.

Is it simple to draw a line in JS? Like in one line of simple and straight code, yes? I mean, not adding some divs to some DOM, but actually drawing a line or circle. Drawing is simplifying things for kids.

Sure! Just locate the element you want to draw in, set up a 2d context, start a path, move to one end of the line, draw a line, and then stroke that line so it fills in! How much simpler could it be really?

> How much simpler could it be really?

The howto could be a whole lot simpler it seems, see this example, helpfully provided by neckro23 https://news.ycombinator.com/item?id=11637866

Re: 30 years later, QBasic is still the best

#115
post #88

There is another ritual after you start with QBasic. Your open gorilla.bas and nibbles.bas. Seriously, play gorilla.bas. It's one of the best games I have played.

I got my 4th grade class to play gorilla, which interestingly came with the Windows NT machines at my school. That and that reskinned Full Tilt! Pinball table Space Cadet. Quite a contrast.

I personally liked modifying nibbles, for instance adjusting the timing loop so it'd be playable on a modern computer. On some occasions I made a special key which would put the snake on auto-pilot (just towards the goal, no graph search or anything), or which would temporarily turn off collision detection. Somehow both of these were possible without really understanding how the whole program worked.

Re: 30 years later, QBasic is still the best

#116
Author is spot on. My son and daughter have about 2 and 4 years to go before I probably intro them to programming. When I do, it's going to be a C64 all the way. And a real one. With a real old school monitor and a luxury a didn't have for about a year or two: a floppy drive.

I've get a lot of the start with JS comments. But that would be the last thing I do. As a child learning, you need to remove the complexities and distractions of a modern system. Windows, browsers, edit js in one app, run it in another, use a mouse, open the js debug console, etc. Just wayyy to much stuff for a young mind to try to focus on.

Don't get me wrong, they probably _can_ learn js, but after decades of programming in all kinds of different languages, just because js is the latest fashion, doesn't mean I'd every try to teach it to a kid. No way.

BASIC, on the other hand, was created _for beginners_. I learned A LOT over the years when I was using BASIC. I also had magazines (COMPUTE! & Gazette) and books that helped immensely. I was just thinking yesterday actually, that it was awesome having the C64 Programmers Ref Guide that had the machine schematics and port pin outs in it!! You'll never get that for a Mac or iPhone nowadays (and these sorts of things usually only show up on 'hacker' sites). This was a book put you closer to the hardware so you could more easily understand what PEEK and POKE really did. :D

I'm _really_ looking forward to the instruction days. The C64 was so popular for a reason: it was powerful & simple. This is how I want to introduce my kids to programming. They'll figure out Ruby, JS, C and things (maybe 8-bit assembly too!) later.

I loved my C64 (still do) and I hope that will rub off on them. Can't wait.

Re: 30 years later, QBasic is still the best

#117

For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are very concrete and have limited abstraction ability. With Basic and goto, a program is more concrete (you run a line which is more or less 1 command) and linear (no nested structures). With structured programming, it is more abstract, and has an recursive structu…

From my experience back when I was 12: once you get ambitious enough in QBasic, you start to wish for some way of organizing the code and making it easier to follow. At that point, an intro to structured programming or OOP is natural. (Probably not functional programming, though, since functional's not very good for games, and what else do you think QBasic is going to be used for?)

> you start to wish for some way of organizing the code

Yes, this is a critical and valuable step in learning. You can't easily learn the solution until you've encountered the problem.

Re: 30 years later, QBasic is still the best

#118
post #112

For young children, QBasic and goto may indeed be superior to more structured languages. From a neuro development perspective we know that young children are very concrete and have limited abstraction ability. With Basic and goto, a program is more concrete (you run a line which is more or less 1 command) and linear (no nested structures). With structured programming, it is more abstract, and has an recursive structu…

I think you might be onto something. For my oldest son I tried to help him along in python. Just poking about in the interpreter went great, but pygame overwhelmed him and when his laptop died he never picked-up again where he left-off. For my youngest son I introduced him to awk first. In an editor he would edit the script and then run it in the terminal. I explained how every line goes in order. At first his script…

You are teaching him awk? Are you trying to create a supervillain?

Re: 30 years later, QBasic is still the best

#120

"When developing a skill, it is much better to acquire the right reflexes from the start rather than have to correct years of bad practice." I disagree with this statement. "Learning" is a long process of acquiring and also discarding habits and knowledge. The best intro I ever read for relativity was "An Equation That Changed the World" and it's a series of dialogues between Newton, Einstein, and the author (a moder…

I'd argue that programming isn't like other skills in this regard. Obviously if you're teaching something like the violin, where there's one right way to hold the bow and learning how to play holding the bow in any other way will ultimately hamper you, sure, it's worth it to drill the One True Way. But coding isn't like that. Sure, GOTOs as a means for control flow, suck for most serious applications compared to the…

Oh that's a really good insight. Yes, totally agreed.
Post reply on HN