First time here? Check out the site's "greatest hits" or read a post from the archives. Feel free to leave a comment or ask a question, and consider subscribing to the latest posts via RSS or e-mail. Thanks for visiting!
Do you Tweet? Follow me on Twitter @shanselman or learn how to use Twitter!
« SmallestDotNet Update - Now with .NET 4 ... | Main | Back to Basics: C# 4 method overloading ... »

While the boys are only 2 and 4, I'm always keeping an eye out on new ways to teach them programming. Certainly I hope they'll be more well-rounded and I and spend more time outside, but a even a basic background in programming and logic, I think, produces a more empowered individual.

Created by Vijaye Raji, Small Basic is a simple (only 15 keywords) but powerful environment for getting started programming. Great for kids and non-technical spouses, but powerful enough even for the professional game developer. In fact, Small Basic is probably the fastest and simplest way I've seen yet to produce and publish Silverlight-based games. Read on to see why.

Small Basic is part of MSDN DevLabs and just released version 0.8. It's the eighth installment, but I suspect they are too modest to call it 8.0. ;) It's even internationalized in English, Chinese, French, German, Italian, Japanese, Jorean, Russian, Spanish, Brazilian Portuguese and Turkish...so if you know a computer teacher, you might tell them about this!

Take a look at Small Basic Tetris, for example. You can run it in the browser with Silverlight, right here. The full Small Basic source code for the app is listed right on the page. There's a bunch of great sample Small Basic apps here also.

It has a nice friendly IDE (Integrated Development Environment) with a clever take on Intellisense as seen below. The IDE goes out of its way to give you as much information and context as possible not only with the intellisense "arc" but also context-sensitive help in the right doc.

The Small Basic IDE

Even more clever, I think, is the "Graduate" button that will convert your Small Basic program into Visual Basic for use directly in Visual Studio.

Here's what a Small Basic text mode application would look like:

number = 100
While (number > 1)
TextWindow.WriteLine(number)
number = number / 2
EndWhile

Here's a SmallBasic Windows app:

GraphicsWindow.BackgroundColor = "Black"
GraphicsWindow.Width = 200
GraphicsWindow.Height = 160
GraphicsWindow.PenColor = "Blue"
For i = 1 To 10
GraphicsWindow.PenWidth = i
GraphicsWindow.DrawLine(20, i * 15, 180, i * 15)
EndFor

For those of us old enough to remember learning to program with LOGO and its ubiquitous Turtle, Small Basic includes a Turtle object built in! Remember this?

sides = 50
length = 400 / sides
angle = 360 / sides
Turtle.Speed = 9
For j = 1 To 20
For i = 1 To sides
Turtle.Move(length)
Turtle.Turn(angle)
EndFor
Turtle.Turn(18)
EndFor

Which gives us this image. See the turtle inside?

The LOGO Turtle drawing Circles in SmallBasic

The most amazing part from a learning perspective is the ability to publish your game directly to the Small Basic website and play it or give it to your friends. I hit Publish for this Turtle app and Small Basic - in one click - gave me this link: http://smallbasic.com/program/?WKN265. Now I can send my friends or students to that link.  They can play the game LIVE, see the source listing right there, or even embed it on their own website with included HTML.

I'm really impressed with the amount of though that was put into this app and how easy it was. I hope other folks at Microsoft check it out and appreciate the simplicity.

Related Links



Tuesday, February 09, 2010 1:52:21 PM (Pacific Standard Time, UTC-08:00)
This is really nice. Simple syntax, user-friendly interface, and the ability to get instant gratification makes this a really powerful and promising tool to teach/learn programming.

Plus, I really like the ability to share your code online with your friends/classmates.

This is complete win, I love to see stuff like this.

Plus, that intelli-sense is killer, where was that when I was in Junior High?
Tuesday, February 09, 2010 2:20:57 PM (Pacific Standard Time, UTC-08:00)
Awesome, I wonder if my wife will try it out hehe
Tuesday, February 09, 2010 2:48:11 PM (Pacific Standard Time, UTC-08:00)
It's so, so, tempting to ask if VB has a "Graduate" button that converts the project into C#, but I'm not going to say that. Nope, not going to start a language war.
Tuesday, February 09, 2010 4:02:33 PM (Pacific Standard Time, UTC-08:00)
I've used this with my 10 year old and it is neat - I don't want to take anything about the implementation with this comment, but... :-)

Are we sure that this traditional imperative non-functional basic style is the right way to start people of programming? I wonder how many new people we are making that will struggle with FP, LINQ or even SQL.

We might be too old and wizened to tell, but we might be teaching the new 'electric' generation how to program using 'steam' because that's how we started, i.e. the paradigms that we are embedding in an early eduction can tend to stick and the future of programming ain't looking imperative folks...

Anyway, just an comment for discussion - SmallBasic is a lot of fun, and I didn't really find anything else as good.
David
Tuesday, February 09, 2010 4:49:36 PM (Pacific Standard Time, UTC-08:00)
That's a very interesting question David. Have you tried teaching your 10 year old Squeak?
Tuesday, February 09, 2010 5:18:16 PM (Pacific Standard Time, UTC-08:00)
I'm from Jordan they teach us programming using at 10th grade using Arabized version of Logo and i think it's nice idea to have this with small basic so kids can learn how to program
Tuesday, February 09, 2010 10:53:31 PM (Pacific Standard Time, UTC-08:00)
I think I would confuse my daughters with the GraphicsWindow and TextWindow stuff. Scratch (http://scratch.mit.edu/) on the other hand is graphical and intuitive. And also... I don't like VB.
Palle Due Larsen
Tuesday, February 09, 2010 11:21:03 PM (Pacific Standard Time, UTC-08:00)
The MIT has a nice project called Scratch that allows kids to develop a program visually and interactively, I think it's easier and more exiting than writing code.

Nordine Ben Bachir
Wednesday, February 10, 2010 1:04:27 AM (Pacific Standard Time, UTC-08:00)
I'm sure you will like to create web applications without writing code but using only mouse and visual scripting.

See a short video presentation here: http://www.youtube.com/watch?v=Krb7OCmTJ-w
or this one http://www.youtube.com/watch?v=F7J9dnIIAVQ

It's perfect for creating business software, but for sure you can find many other uses to it...
Wednesday, February 10, 2010 5:35:08 AM (Pacific Standard Time, UTC-08:00)
Thanks for pointing out this language; I might try it in the future. I agree that learning the basics of logic does make for a more empowered individual, so I plan on teaching my HFO's (hypothetical future offspring) the basics of logic and computer programming.

Scratch is _great_ for teaching the very basics.

I haven't found good instructions on Squeak or eToys yet.
Wednesday, February 10, 2010 9:18:13 AM (Pacific Standard Time, UTC-08:00)
I gave a talk at the Twin Cities Languages User Group on Small Basic last year. Many people were interested in it for their kids. On top of that I discovered some of my youth again when using it. It felt like I was going back to 5th grade on an Apple IIe. I really hope Vijaye's dream of having it bundled with Windows comes true. Not having a programming environment built into Windows impedes upon newcomers to programming. Many of us first were exposed to programming because the OS we had on our first computers had some environment to program in. Apple IIe BASIC, QBASIC..

It is definitely a quick to learn and fund language/platform to use. Extending it is extremely simple for any .NET developer. There have been some great extensions released for it already.
Wednesday, February 10, 2010 11:00:20 AM (Pacific Standard Time, UTC-08:00)
I and some friends have just set up an after school 'code 4 kids' club for 12-16s at our local High School here in the UK. Believe it or not but the actual curriculum doesn't touch code until the guys reach 16...madness!

Anyway, we are working with MS VS Express and coding4fun (http://blogs.msdn.com/coding4fun/) and are definitely going to take a good look at SmallBasic as another resource we can 'tap' into.

If anyone has any further info or insights on 'code4kids' we're all ears...thanks!
Charles Turton
Wednesday, February 10, 2010 11:20:46 AM (Pacific Standard Time, UTC-08:00)
broken link: bunch of great sample Small Basic apps here also
Don
Wednesday, February 10, 2010 6:44:18 PM (Pacific Standard Time, UTC-08:00)
Not seen the LOGO turtle for years that was a great little intro to programming for the time. I suspect some of my colleagues would prefer this to the usual business and data entry apps I give them :-)
Thursday, February 11, 2010 12:22:12 AM (Pacific Standard Time, UTC-08:00)
I've almost forgotten about LOGO - awesome programming Language. I wrote a whole bunch of apps when I was 13 or so but later on I got annoyed because there was a pretty low memory limit in the version I was using. Still, a very nice starting point for new programmers.
Friday, February 12, 2010 2:41:02 PM (Pacific Standard Time, UTC-08:00)
Smallbasic is nice. I have been using it to teach my son and daughter. I also picked up the Hello World book. Going to start moving through that one also.
Sunday, February 14, 2010 1:28:10 PM (Pacific Standard Time, UTC-08:00)
So this is VB's final resting ground?
Wednesday, February 17, 2010 6:38:42 AM (Pacific Standard Time, UTC-08:00)
Thats cool. The below line in the For loop giving wonderful random colors. Tried it in both inner and outer for loops.

GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()


Thanks,
Kamlesh
OpenID
Please login with either your OpenID above, or your details below.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, pre, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Live Comment Preview

Contact

Sponsors

Hosting By

Hot Topics

Tags

Calendar

<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910

Archives

March, 2010 (10)
February, 2010 (17)
January, 2010 (13)
December, 2009 (13)
November, 2009 (7)
October, 2009 (19)
September, 2009 (11)
August, 2009 (12)
July, 2009 (21)
June, 2009 (26)
May, 2009 (16)
April, 2009 (13)
March, 2009 (17)
February, 2009 (17)
January, 2009 (18)
December, 2008 (32)
November, 2008 (17)
October, 2008 (22)
September, 2008 (16)
August, 2008 (14)
July, 2008 (25)
June, 2008 (19)
May, 2008 (17)
April, 2008 (17)
March, 2008 (26)
February, 2008 (21)
January, 2008 (28)
December, 2007 (19)
November, 2007 (17)
October, 2007 (31)
September, 2007 (39)
August, 2007 (37)
July, 2007 (43)
June, 2007 (37)
May, 2007 (32)
April, 2007 (38)
March, 2007 (29)
February, 2007 (46)
January, 2007 (31)
December, 2006 (27)
November, 2006 (31)
October, 2006 (32)
September, 2006 (39)
August, 2006 (34)
July, 2006 (40)
June, 2006 (18)
May, 2006 (31)
April, 2006 (34)
March, 2006 (30)
February, 2006 (38)
January, 2006 (44)
December, 2005 (19)
November, 2005 (34)
October, 2005 (24)
September, 2005 (37)
August, 2005 (20)
July, 2005 (24)
June, 2005 (33)
May, 2005 (16)
April, 2005 (22)
March, 2005 (34)
February, 2005 (15)
January, 2005 (37)
December, 2004 (28)
November, 2004 (30)
October, 2004 (34)
September, 2004 (22)
August, 2004 (34)
July, 2004 (18)
June, 2004 (64)
May, 2004 (49)
April, 2004 (21)
March, 2004 (29)
February, 2004 (29)
January, 2004 (36)
December, 2003 (25)
November, 2003 (24)
October, 2003 (59)
September, 2003 (42)
August, 2003 (24)
July, 2003 (44)
June, 2003 (29)
May, 2003 (21)
April, 2003 (30)
March, 2003 (27)
February, 2003 (47)
January, 2003 (50)
December, 2002 (31)
November, 2002 (38)
October, 2002 (44)
September, 2002 (15)
May, 2002 (2)
April, 2002 (4)

Google Ads