Learn How To Write Computer Program with SmallBasic

small basic logo   Learn How To Write Computer Program with SmallBasicSomebody at Microsoft is doing things right in my humble opinion. What they’ve done with Small Basic is reintroduce hand-coding software, but with just a little less help than drag-and-drop or WYSIWYG interface. Let’s take a look at at it shall we?

Take a look at the interface. Doesn’t look like much more than a prettified Notepad, does it? Well, in many ways that’s what it is. No Object Toolbars, no colour selectors, no fancy element properties windows. Just you, a keyboard and a screen. That’s the beauty of it. Immediately, it showed me my weakness, my dependency on wizards and ready-made objects. As I stared blankly at the screen, I tried to think of just one Basic command that I could get started with. Nothing.

small basic workspace   Learn How To Write Computer Program with SmallBasic


Now, in my defence, I haven’t written a Basic program since college. Yet, even then we were taught on VisualBasic 6. So I first looked for the elements that I could just drag into place. None. Nowhere. My next move was to do the unthinkable – go to the documentation. But wait! There isn’t even a Help menu. I remembered good old F1. Nothing!

I went to the Program Menu from my Start Button and looked under the directory for Small Basic. There it was, the thing that really makes this program worthwhile – the Introducing Small Basic (ISB) document.

As all good introductions to programming guides should, the ISB started me off with a “Hello World” program. If you’ve done any learning of programming languages, you’ll know what that is. The ISB says you just type this line in:

TextWindow.WriteLine("Hello World")

I started typing…T..e…x…what? What is this thing that came from nowhere with information just for me? That’s the Intellisense function of the application.

small basic intellisense   Learn How To Write Computer Program with SmallBasic

This is what separates Notepad from Small Basic. Whenever it senses that I am typing something meaningful, it will show me a list of options that you can scroll through using your up and down arrow keys. Each item has a short description beside it so I can decide if this is what you need, and how to use it. When I find the term that I want, I strike the enter key and it will auto-complete for me. This is such a nice happy medium between coding in Notepad and being lost in the gloss of the latest full-blown VisualStudio. I think you’ll like it.

Once I have my “Hello World” program done, I can save it by clicking on the Save As button.

small basic save as   Learn How To Write Computer Program with SmallBasic

Then I can run it by clicking on the Run button. Or, as the button shows, I can also press the F5 key to run it.

small basic run   Learn How To Write Computer Program with SmallBasic

So let’s run it and see what happens.

small basic hello world   Learn How To Write Computer Program with SmallBasic

The program opened up a Command window, or DOS window as some call it, and printed out “Hello World” just like I told it to. Since I didn’t write anything to tell the program what to do next, Small Basic automatically gives me the Press any key to continue… prompt.

Now, a bit about shortcut keys since I already touched on the F5 keys. Many of the popular shortcut keys do work with Small Basic, such as ctrl+s for saving.

If you’re thinking this is pretty rudimentary and simplistic, you’d be right. Yet, that’s the point of it. The point is to give the new programmer a usable environment, decent documentation and the spartan workspace needed to develop life-long programming skills and practices. In just 69 pages, the ISB document teaches the new programmer about variables, arrays, conditions and branching, and loops. With these basics of programming, you can go a long way.

If you’re also thinking that the programs that you could do with Small Basic would be useless or visually boring, think again. Small Basic does give you the ability to use interactivity with your user, create graphics and use colour. Another neat built in object is the Turtle. Turtle makes Small Basic a useable platform for teaching kids to program. Who can resist telling a Turtle to move 100 spaces and then watching it go? Or how about watching Turtle draw a fractal?

Old pro or newbie, or proud parent passing skills on to the offspring, Small Basic is a seriously fun tool for programming with. Give it a try. Let us know what you think about it.

Have you already done some work in Small Basic? Show us where we can see a sample in the comments below.

The comments were closed because the article is more than 180 days old.

If you have any questions related to what's mentioned in the article or need help with any computer issue, ask it on MakeUseOf Answers—We and our community will be more than happy to help.

19 Comments -

0 votes

Sourish Nath

Hey ,nice info.The youtube video was awesome.
Thanks ,

Regards ,
Sourish

0 votes

Guy McDowell

Thanks Sourish,

I really liked working with Small Basic. There’s only 14 terms to work with. Makes me think again.

0 votes

chris

Hi! If you like MS small basic you might also like to give the original “SmallBASIC” a try – it’s freely available at http://smallbasic.sf.net

0 votes

Brian H.

When I was a kid, we learned to “program” computers using Logo. We were told to “move the turtle 10 spaces and turn right”. :D Great intro to computer programming. :-)

I am definitely going to use this to teach my boys programming when they get older.

0 votes

David

Why not use Logo? The turtle was a Logo project, after all. A lot of details can be found at the Wikipedia article, including pointers to free and open source Logo variants.

0 votes

Guy McDowell

Logo is good too! The Small Basic manual references Logo when they talk about Turtle.

0 votes

Tyler Garland

This is pretty awesome. Thanks

0 votes

1fastbullet

“Somebody at Microsoft is doing things right…”

I find this reassuring. Now we know that everyone at Microsoft isn’t a fuckup.

0 votes

Guy McDowell

I didn’t say that they were all f*&kups. Not sure how your comment got posted in the first place either with foul language.

Microsoft has done some absolutely amazingly good things of course. Yes, they had their Bob’s and such, but really, you can’t stay at the top unless you have what people want.

0 votes

jack2468

i like smalll basic but i wish they would teach you more than just what they have there. you know what i mean.