Scott Hanselman

The Weekly Source Code 49 - SmallBasic is Fun, Simple, Powerful Programming for Kids and Adults

February 9, '10 Comments [20] Posted in Learning .NET | MSDN | Programming | Silverlight | Source Code
Sponsored By

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 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)
number = number / 2

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)

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

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: 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

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Visual Studio 2010 Beta 2

October 19, '09 Comments [46] Posted in ASP.NET | ASP.NET Ajax | ASP.NET Dynamic Data | ASP.NET MVC | Learning .NET | Microsoft | MSDN | Programming
Sponsored By

VS_v_rgbLots of big stuff happening this week. Today Visual Studio 2010 Beta 2 is available to MSDN Subscribers and it'll be available for everyone on Wednesday.

I'm running Beta 2 on all my machines now and really digging it. It's much faster than Beta 1 and I'm doing all my work in it now. It's come a long way and I'm really impressed at the polish.

.NET 4

This is a big deal. This isn't ".NET 3.6" - there are a lot of improvements of .NET 4, and it's not just "pile on a bunch of features so you get overwhelmed." I've been working with and talking to many of the teams involved and even though it's a cheesy thing to say, this is a really customer-focused release.

Shouldn't every release be that way? Sure, and in this case there's a really clear focus on, as I like to say, "making the Legos the right size." This is as much about tightening screws as it is about adding new features.

There's more goodness that I can put in one post, but some personal favorite highlights are:

  • Quicker to Install - A smaller Client Profile with a much smaller initial download (down to 0.8 megs from 2.8) for bootstrapping .NET client apps faster than ever)
  • Side by Side - .NET 4 is a side-by-side release that doesn't auto-promote, meaning you won't break existing apps and you can have .NET 2.0, 3.5 and 4 apps on the same machine, happily.
    • Side-by-side CLR support for managed add-ins inside of apps like Explorer or Outlook. Again, new and existing apps in the same process, chillin'.
    • For more details on Application Compatibilty, check out the AppCompat Walkthrough for .NET 4 on MSDN.
  • Dynamic Language Support - The DLR (Dynamic language runtime) ships built-in with .NET 4 so you can mix-and-match your solutions and pick the best language (or languages) amongst C# and VB.NET as well as F#, IronPython and IronRuby. This includes better support for COM (yes, COM! People do use COM and it's even easier with the new dynamic keyword in C# these days.)
  • More Web Standards Support - Better support for WS-* and REST making interop easier. (I love ADO.NET Data Services, but you know that already, Dear Reader. I'm a bit of a RESTafarian, these days.)
  • Plugins Galore - Visual Studio 2010 uses MEF and WPF to enable a whole new world of clean managed extensions as well as an Online Gallery (there's an extension for that!)
  • Multi-Framework Multi-targeting - You can't really overestimate how useful this is, but a picture is worth a thousand words. You can code all your apps in all your organization's frameworks with the same IDE:
    WindowClipping (3)

Keep an eye on the blogs this week as the various teams talk about their favorite features.

On the ASP.NET 4 side:

Oh, yes, one other thing…

Fresh Look



You may notice a few things in the new Splash Screen above. There's a new Visual Studio logo that goes nicely as well as a new logo for MSDN. You probably heard that we launched a new MSDN this weekend and today we add the new logo and background. This new MSDN is the beginning of a more agile, community focused MSDN and you should expect to see and hear of cool stuff coming from the team, often, in the months to come. Of note will be the new MSDN Lightweight view, soon to be the default view for the library. 

In the coming weeks I'll dig into more details on the these new things and how they work together:

  • Visual Studio 2010 and .NET 4
  • Windows 7
  • Microsoft Developer Network

Enjoy! Also, be sure to check out Soma's blog post and go get Visual Studio 2010 and .NET Framework 4 Beta 2 as soon as you can!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

A new MSDN for a new Operating System and a new Development Environment

October 8, '09 Comments [84] Posted in ASP.NET | Learning .NET | Microsoft | MSDN | Programming | Win7 | Windows Client | WPF
Sponsored By

New VB Home PageThe team I work at Microsoft for is called Server and Tools Online, and one of the things we work on is the Microsoft Developer Network or "MSDN." If you go way, way up, our boss is Soma (Yes, this Soma), but down here in the trenches there's the folks that make content and systems to help you after you "File | New Project."

Our goals this year are to get back to basics and make sure that our online user experience meets these goals in as few clicks as possible.

PREVIEW: Check out the Live Preview of the new VB Dev Center. Other centers will follow.

INTERNATIONAL UPDATE: Our international team members are writing blog posts of their own:

A few months ago I snuck a few "comps" out of a meeting with the designers on MSDN. A few months before that we talked about the a upcoming "loband" option for MSDN and performance improvements to the MSDN library that are bringing page-load times for the MSDN library to the 1- and 2-second level.

There was a lot of great comments and feedback from you in the comments of both of those posts and I took it all straight to the teams.

There's a bunch of big stuff going on in the next few months. We've got a new Operating System (Windows 7 is launching on Oct 22, in case you've been living in a cave, or a small home office like me) coming, there's also Microsoft's PDC November 17-19, and you know how we like to announce fun stuff at PDC. :)

I've got a bunch of comps (these are not final) from a recent meeting I wanted to share with you about what's new at MSDN to support all this newness and fix some old problems.

New MSDN - Why?

To be clear, this is more than a "visual refresh." Sure, there's a new design and it's pretty, but this is more about UX (User Experience) than it is about swapping out icons. We've got 5 main goals as a team to enable you, Dear Reader:

  1. HELP ME - I've got a problem. What's the answer, quickly and accurately.
  2. CONNECT ME TO PEOPLE - There's other people like me, connect me to them, and to the product group.
  3. GET ME THE DOWNLOAD I NEED - Get out of my way, I just want a download. Bits, Scripts, Utils, Code, etc.
  4. CONNECT ME TO THE PRODUCT - What's new with Product X? I've got feedback and I want to be heard.
  5. KEEP ME SMART - I'm looking to sharpen the saw.

Our goals are to be transparent and authentic. I think you've seen that on this blog since day 0, and hopefully in the last two years after I joined Microsoft. The web continues to evolve and we want an MSDN that better reflects a focus on community, on fresh content, and on making things easier to find.

What's Coming

We'll be launching an entirely new MSDN very soon and I'll have all the details for you, Dear Reader, here on my blog. You'll be able to see a live pilot of the new design in the VB Dev Center this week. This will be part of an ongoing reinvention that will span the next year. We'll be listening to you and making sure you're getting what you need. For now it's at /vbpreview, and soon you'll see it the new layout at /vbasic and all of MSDN will change.

We're adding guidance for new developers on every Dev Center Home Page. There's also a renewed focus on consistency across the whole network. You'll find Related Content in the right margin throughout the network and primary content top center of every page.


There's a number of new active controls with dynamic community content. More content than ever will be driven by feeds and tagged so the freshest and most relevant content is easy to find.


Another focus is learning, particularly around educational videos and screencasts. There's a pile of them, but historically it's been hard to find the ones that apply to you, and no way to add comments and questions. This release adds video sharing, comments and ratings. There's also plans for a new video scroller - this is an artist's rendering I found in a design PPT.


Community Activity

More areas of the home page will be active content driven by feeds and bring people with interesting content, comments, code and perspectives to the front. It'll be easy to find what's new and what's popular in Forums, Galleries, Video and Code.

Community Activity


Another point of focus for this first upcoming release is downloads. I've been beating the downloads drum since I got here and this release changes puts Downloads right up front. The downloads are better organized and all consistent. The Top downloads and samples are more visible and updated more often, putting them often within two clicks.

Even More To Come

I hope you'll agree when you see the new site that it's got better discoverability, readability, consistency and most importantly, more relevant content. You'll see more fewer, more focused Dev Centers, more task-oriented content, and more community content.

This is all the start of a leaner meaner MSDN and it's just the first "wave." I'll post about some other cool changes that we've got coming down the pipe soon.

Be Heard

A lot of people are working hard to make MSDN fresher, more relevant, faster and easier to navigate. Everyone is actively monitoring the MSDN Feedback Forum so if you've got questions, concerns, feedback, ideas or compliments, that's the spot. You can also post here in the comments and I'll make sure the right people hear what you've got to say!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

MSDN Updates - and RFC for you

June 5, '09 Comments [61] Posted in Microsoft | MSDN
Sponsored By

There's a bunch of stuff going on over at MSDN. They're making some cool changes and aren't afraid to break a few eggs to make an omelet. I used to think that MSDN was this static, non-moving thing, but I've been meeting with a bunch of folks on the various sub-teams and I'm seeing a resurgence of agility. (MSDN, agile?! Madness! No, seriously.) Soma blogged recently about some of the changes.

Here's some of the stuff that's been going on lately at MSDN, as well as a Request for Comments (RFC) from me.

Alternate MSDN Views

I blogged while back about alternate views for MSDN, including a Low-Bandwith (loband) view. MSDN includes the Home Page (of course), the MSDN Library, Downloads, Community and Forums. The library experience (LEX) team has updated the loband view as well as the new  dev10ide view. They're aiming for sub-1-second load times, small page weight and they are reading all the feedback


image The MSDN Forums have been updated and are now written in ASP.NET MVC. This, along with other changes has made the forums markup much smaller and the site much snappier. This forum upgrade went out to all MSDN/TechNet forums, including the Windows 7 Forums and Windows Client Development Forums.

The Forums are also more answer-focused now, kind of like StackOverflow. You can see how many questions remain unanswered, mark questions answered, and browse by tag. There's also filters like "hascode" to show only Q&A with code, or you can show only "helpful" answers, or just proposed, but not accepted answers.

The Forum Reading view has been updated with AJAXy goodness, so you can expand threads without leaving the page.

Other tweaks to MSDN include, the MSDN Community Center that includes not just blogs, but also tweets, delicious links, Technorati results and Diggs.

What would a new MSDN look like?

Chris Sells told me once:

"If you're not getting in trouble at least twice a year, you're not doing your job."

This statement really changed the way I thought about my job. It's good to push the envelope.

I was in an MSDN redesign meeting and they were brainstorming on some potential designs. I said, hey, let's go crazy here and try some way-out-there-MSDN designs. A bunch of emails have been thrown around and since they never explicitly said "don't blog this," I figured, why not ask you guys, then take the feedback/comments you give directly to them.

This is just brainstorming, to be sure, VERY early on for a potential redesign. I picked a few comps that the designer was working on that were in the same vein, but different in purpose.

First, here's a concept design for a a would-be MSDN Home Page. There's two goals here, and a visual refresh is just one of them. The other is to change the user experience to make it easier to find things. To make it easy to find things you need, but also have enough active content to have "serendipity" moments when you see something you wouldn't ordinarily.

There's a community visualizer at the middle there. It'd be an active widget and clicking on the left site would get you real-time results with recent activity, most popular items, etc from all over the network.

The Developer Centers are called out on the left-side to get you to the top areas in one-click. I pushed them to get you from the MSDN Home page to mostly anywhere in one click, two tops. For example, downloads has the most likely download links. At the bottom, you can get to other sites within the network.


Perhaps a lighter frame?


Darker? Notice the "channel bar" at the top in gray.


Perhaps a compromise?



This potential home page is as a result of me saying, do the opposite of what we'd ordinarily do. Is the MSDN Home page too visually busy? Make it simpler. How simple can it get, and if it gets simple, does it still provide value?


Perhaps without the blue frame? Even simpler?


Please offer your opinions and comments here. MSDN is your site and if you have an opinion, make it heard and I'll pass them out to my bosses. How should the site look? How do you want to use it? What do you think of these designs? What works and what doesn't?

If me leaking designs like this is helpful, tell me here and I'll use them as character references at my Court Martial. All the better if you find it helpful, then I'll have good reason to share even more, even earlier in the process.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Low Bandwidth View and other Hidden (and Future) Features of MSDN

April 17, '09 Comments [37] Posted in ASP.NET | Microsoft | MSDN
Sponsored By

Ok, so I'm only 8 months late. ;) Last year MSDN quietly implemented a "low bandwidth" view.

Low Bandwidth MSDN

Basically, instead of visiting: 

you could add "(loband)" to the URL, like:

Instead of the standard MSDN page:

XmlNode Class (System.Xml) - Windows Internet Explorer

You'd get a nice streamlined version. This is great for not only low-bandwidth situations, but also phones, pdas, screenreaders, etc. More on that in a second.

XmlNode Class (System.Xml) - Windows Internet Explorer (2)

Jon Galloway noticed this last August and even made a nice bookmarklet to make it easier to get into this view. Fast forward until last week when I noticed that this existed. I started digging around, because not only was it cool, but my spider-sense was telling me there was more underneath the story.

I called Kim, the Development Manager for the project and I asked as many leading questions as I could, in order to find out what they were planning to do with this, how it was done, and if there were any hidden features. Sometimes folks kind of give MSDN a hard time for having fat HTML, lots of scripts, etc, and generally being slow. Turns out there's a whole ongoing project to make MSDN way faster and it's already seen some really significant improvements. I've got some internal slides she smuggled my way that I'm going to share with you here, so don't tell. I figure show first, ask question later, right? This is great stuff.

MSDN Performance

They use a number of tests at MSDN to see how fast the site is running, including Gomez and Keynote. Keynote and other tools not only do testing like YSlow and the like, but they do location testing to make sure the site is fast all over the world. That means testing it on a modem in China and DSL in Australia, etc. For example, you'll see Guangzhou, China appear in the slide deck a lot because it happened to be where MSDN loaded the slowest. The roll-up slides (for bosses) show Seattle, Paris and Beijing. In some places there was missing data.

Here's a slide from last Feb before the big performance push started. Notice the page sides is between 200-250k and the response time in China is 10 seconds. Good, I suppose, but not fast.


They'd test MSDN on first load, then second (cached) load. They called that PLT1 and PLT2 respectively. The first load of MSDN was like 1.3 megs. Insane. Adobe's site was 800k+, Java's was 800k+, but library sites like Ruby and Eclipses around 200-300k. A meg is not cool. They broke it down by JavaScript, HTML/CSS, Images, etc.


Over the next few months, they started moving CSS and scripts to separate DNS for HTTP Pipelining, reduced the number of redirects, were smarter about JS caching, lazy-loaded the Table of Contents. They started caching scripts at CDNs like Akamai and ChinaCache, reduced or removed ViewState.

Then the idea of flipping the whole thing on its ear happened. Rather than removing this and that, why not remove EVERYTHING, and only add back what was needed. Hence, the loband version was created.

Here's some performance tests between the loband MSDN on an unnamed technologies very-fast library site (you'll have to click the image to see the numbers):


The loband MSDN site can get sub-second times in the states and very close to one-second times outside the states, including Guangzhou, our previously slowest location.

Early versions of loband were 25k, but some changes brought the average down to just over 15k. Caching changes and other optimizations brought the performance by region down to under 2 seconds basically world-wide.


Here's an interesting graph showing the size of JavaScript, HTML and images on MSDN and a bunch of other sites, including In this chart, regular full MSDN in Feb of 2008 is the FAR left bar, and MSDN in July is the second from the left. The loband size is the second from the right.



You can click "persist low bandwidth view" if you want to make it your default. Also, they are paying close attention to the Feedback forum, so click that if you have more ideas. The next version of the loband site will be coming out in the next month and looks like this (sneak-preview):

XmlNode Class (System.Xml) - Windows Internet Explorer

They've removed the black bars, some markup changes, and the layout stretches horizontally better.

Additional MSDN "Switches"

I figured there can't just be the (loband) "switch" and I mentioned I thought that having to hack the URL was kind of wonky. Turns out that the whole MSDN system isn't a bunch of files on disk, but files in a database with an ASP.NET Virtual Path Provider. Tim Ewald wrote about how they did this WAY back in February of 2005. This was, at the time, kind of a poor-man's ASP.NET Routing:

The normalized path points to a file that does not exist on disk. Rather, the page data is stored in the content cache. The system uses a VirtualPathProvider (VPP) to bridge the gap between the two. In essence, a VPP intercepts all of the ASP.NET plumbing's requests for file streams and gives you a chance to load them from wherever you like. Every ASP.NET app uses a default VPP that simply maps to the file system. An MTPS-based site registers a custom VirtualPathProvider, which sits in front of the default VPP, forming a chain. The custom VPP uses the DocumentInfo and ContentSet objects that the HTTP module's OnPreResolveRequestCache event handler stored in HTTP context to load a topic from the content cache and return it as an .aspx file stream.

All of this is abstracted away, and what I'm calling a "switch" in the URL is what MSDN calls a "device" internally. The URL is just one way to indicate to their routing system that you are a certain device. The other way is via a User-Agent string, as you'd expect.

The content in MSDN is stored as XHTML, but then other controls are injected around it, similar to master pages. The whole page doesn't yet validate. If you think that's important, put it in the comments. If we get hundreds of comments here I'll pass them on to the team as "evidence," heh, heh.

There are in fact many "devices" for various reasons in MSDN. Most are turned on my User-Agent differences or for things like the Printer-Friendly view. However, you can force the device by inserting the device name in to the URL like:

There are also things called iRoots. For example, the word "Library" in the URL above is an iRoot. I could swap in the word "Magazine" and get a site that's skinned for MSDN Magazine.

Here's the devices I've figured out so far:

Low-Bandwidth - (loband)

This is the one we've been talking about. It's a minimal view, focused on one thing, speed.

PDA - (pda)

The best view for phones or PDAs. Turns off the left side navigation and makes the page 100% width and flexible.

Robots - (robot)

Optimized for search engines. Lots of meta data, no stylesheets, bare-bones. The Table of Contents is at the bottom of the page.

Printer-friendly - (printer)

Optimized for printing and includes a call to window.print().

Now, here's where it gets interesting...

MSDN Inside the (IDE)

When MSDN library content is viewed inside the Visual Studio IDE, a few things are added. First, the ability to Add Content via the MSDN Wiki is promoted to the top, as well as a "send" and "give feedback" feature. This is the view you get when you're inside the "Document Explorer" - the Visual Studio MSDN help browser.

MSDN for Visual Studio 2010

This is still up in the air, but you can see some ideas with the (dev10ide) switch:

XmlNode Class (System.Xml) - Windows Internet Explorer (3)

Here's a zoom in to a nice detail. Currently on MSDN online there's a filter dropdown to choose what language you want to see code samples in.


This live prototype has the languages for code samples appearing as tabs (as see above) including the option to "View Plain" or "View Colorized." There's also links to Copy to Clipboard or Print just the sample directly.

Future MSDN Plans

From what I hear from Kim, there's plans in process now for the loband site to become the default site this fall. They'll call it something like lobandlight and it'll have some small additions like a search box, selectable codeblocks, but the focus will be on being fast and clean. If you have opinions either way, leave them in the comments here or in the loband forums and they WILL be read by the MSDN team. Also, right now loband only works on the library, so while you can try these "devices" on other parts of MSDN, it's only currently designed to work with the MSDN Library itself. If you feel strongly that other parts of MSDN need loband lovin', let me know here and I'll pass your comments on directly to my boss.


About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb
Previous Page Page 2 of 3 in the MSDN category Next Page

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.