Learn How To Write Computer Program with SmallBasic

Ads by Google

small_basic_logoSomebody 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.

how to computer program


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.

Ads by Google

how to write computer program

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.

how to computer program

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.

how to program

So let’s run it and see what happens.

learn how to program

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.

Join live MakeUseOf Groups on Grouvi App Join live Groups on Grouvi
Windows Troubleshooting
Windows Troubleshooting
6 Members
Windows_10
Windows_10
5 Members
Windows Hacks & Customization
Windows Hacks & Customization
17 Members
Best Windows Software
Best Windows Software
9 Members
Ads by Google
Comments (19)
  • jack2468

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

  • 1fastbullet

    “Somebody at Microsoft is doing things right…”

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

    • 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.

  • Tyler Garland

    This is pretty awesome. Thanks

  • 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.

    • 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.

    • Guy McDowell

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

  • 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

Load 10 more
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.
Affiliate Disclamer

This review may contain affiliate links, which pays us a small compensation if you do decide to make a purchase based on our recommendation. Our judgement is in no way biased, and our recommendations are always based on the merits of the items.

For more details, please read our disclosure.