Ask HN: Any interest in a modern QBasic?

11 points by _vya7 ↗ HN
My son started playing with QBasic the other day. He's really getting a lot out of it.

It's really convenient to get started in. It's super helpful that it's an IDE with a built-in interpreter and comprehensive help section. The semantics aren't that hard to pick up. And it has a built-in basic graphics library.

But it's lacking in a few areas. The IDE's fixed screen resolution is really hard to work with. In general QBasic's syntax is confusing and inconsistent. The IDE is missing important features like undo/redo, which I totally forgot about.

So I was thinking, why not write a modern alternative? My plan was to build a very lightweight IDE (probably using Qt), that has a built-in interpreter, using a custom language (probably a stripped down version of Ruby without all the crazy). It would probably use something like SDL and export a basic graphics library too. And it would come with a comprehensive help section including a tutorial.

Is there any interest in using and/or helping with such a project?

(I've looked at a few existing options. Most of them seem to be more drag-n-drop "visual" languages, which I'm not interested in.)

28 comments

[ 3.2 ms ] story [ 46.8 ms ] thread
Why don't you make your IDE around python and pygame?
Couldn't you just wire up a graphics library in Python, and give him a Sublime Text editor configured so that CTRL+B runs his python script? I'm not sure reinventing the wheel on this one makes sense, considering the power and simplicity of some of the environments out there, PLUS, python would provide him with real-world skills.
I want to give him the most frictionless experience getting started. And Python has plenty of dark corners that he might run into pretty quickly. Plus I want to spare him from significant whitespace for a while (but significant newlines are fine). That's why I was envisioning something like Ruby but a little simpler.
(Note: I use Python a lot, so sort of biased, maybe ...)

>I want to spare him from significant whitespace for a while

Reasonably smart kids can understand a lot of things if one takes the time to explain it to them a bit, along with the reasons why a particular thing is the way it is.

I'd suggest you try to avoid dumbing things down too much, just because he's a kid. You might be surprised.

Logo (language) could be another option, and is pretty cool for kids (of all ages :) There are free versions available, just google for them or see the Wikipedia page for Logo.

It's not about understanding. I'm sure he can understand it just fine. But he's also learning how to use an editor. Throwing in significant whitespace is just going to add frustration.
IMO, that's not such a big deal - understanding what significant whitespace is, if you're prepared to have him deal with significant newlines, as you said. But it's your choice, of course ...
Before you go too far, have you checked out http://racket-lang.org/ ?

Dr. Racket is pretty darn good, and racket is a reasonable language. Plus, I think someone over there is still chipping away at http://www.pyret.org/

An important part of QBasic is the built-in 2D graphics library. It's a big motivating factor for him. Does Dr. Racket come with one?
If you look at the racket quick start guide, the third example is drawing a circle. You make a checkerboard about a page later.

It's not as advanced as something like processing, but it's far easier than doing graphics with QBasic back in the 80's.

Have you tried FreeBasic + FBide? http://www.freebasic.net/

It's almost compatible with QB, but it lacks some of the debugging facilities.

My favorite feature was stop-edit-and-continue. I still miss it, but it’s very difficult to implement in a compiled language.

This takes me back 10 years. Yep, I switched to FB at one point. But it took the route of C++ (I mean literally, they just started copying lots of C++ features and syntax). That's something I want to spare my son from.
Rather than QBasic, I would like to suggest Monkey-x http://monkey-x.com

it has a great toolchain, built-in IDE, and supports many, many platforms (Desktop, iOS, android, HTML5, others). The syntax is more modern, and is being used in many commercial games.

I have also yearned for my simplistic old Basic days, but I think it's more nostalgia than an actual void in computing which needs to be filled.

I don't know how old your son is, but I think he'd be better served by learning something relevant and extensible, than some custom language intended to him from scary programming. The Python and editor idea was good, though it doesn't necessarily have to be Python.

He's got you there so if he wanders into some "dark corner" of the language it's not like he's screwed and without help. That was my major impediment to learning programming as a child, not having someone there to explain things. I was 6 years old and got stuck on the concept of an array and my progress ground a halt. Later on I found a friend who could explain harder things like structs and enums and this made programming much easier.

So, just show him tools and be there when he has questions is my best advice.

I get what you're saying, and I appreciate the good-will. But when I taught my brother Ruby last summer, I found myself apologizing for so much inconsistency and insanity. I think it ended up turning him off to programming. I want to avoid that with my son.
Have you looked at something like the iPad app codea? http://twolivesleft.com/Codea It uses LUA for the scripting language, and a really nice IDE.

We also did something similar, except it is all visual programming (I know you said you are not interested in visual).. Its called GamePress (http://www.gamepressapp.com), free iPad app check it out :)

How old is he? I have a 11 year old niece, and she is learning Javacript (using code combat and codecademy) and Python at a good pace.
He turns 10 in a few weeks. But I'm really trying to avoid having to apologize to him the whole time he's learning, which is why I'm avoiding JS, Ruby and Python.
Why would you apologize?
I meant being apologetic for the language: "Remember how methods use parentheses to group arguments? Well anonymous functions use pipes for some reason. Yeah I know, it doesn't make sense to me either. It's just one of those things you have to memorize."
There's a "modern" qbasic called qb64. Have you looked at it?

I also second the recommendations on python (which has a built-in turtle and awesome libraries like pygame).

Racket is also a very good choice. DrRacket is a solid IDE and the language has plenty of good basic libraries. The book Realm of Racket might also be of interest: http://realmofracket.com/

Yeah, we tried qb64 out a few days ago. Its IDE is a little broken in the latest release. Any time you press any key, you have to wait anywhere from 2-5 seconds before the computer reacts. It's apparently part of its syntax-check-as-you-type program, but there's no obvious way to turn it off.

I just tried DrRacket last night, and the IDE was pretty confusing to get started with for me. Plus I think it will be easier for him to get started with a non-Lisp language. (Disclaimer: my favorite language right now is Clojure.)

You should use Python + PyGame.
I hope to spare my son from significant whitespace for a good while.
Don't. The (programming) world isn't perfect and trying to protect him from anything "confusing" or bad will not help him in the long run. Instead, explain. If you don't have a good answer, research the reasons. Getting to know and working around (or with) the quirks of the system is important. Don't take that away from your son.
I generally agree with that point. That's why I'm starting him off on QBasic. Actually if I can find a good graphics library for it, I might teach him Julia next.
Why would you want your own biases get in the way of educating your son? Python is a great first language because it is both approachable and practical. You can go in any direction... webapps, scientific computing, and even games (as I've already suggested).

I learned QBasic when I was 9, when I was 11 and realized the world wasn't developing real applications in QBasic, I was pretty upset and never wrote a line of QBasic ever again. I was pretty bummed at the time, and moved on to C.

There certainly is a reason top universities are moving to Python to teach beginners programming...