Archive for November, 2008

If I Were To Create A “New” Beginner’s Programming Language

November 21, 2008

I recently took the things I learned from my old Sandbox Script based on XML, and wrote a new iteration called Straw Script.  The main addition in functionality was the ability to specify operator and functions.

I’ve also played a bit with microsoft small basic.  I blame John Hattan, of course.  I wrote a quick JetLag game and a Snake game.  While MSSB is a good idea with its heart in the right place, I think it is too dotnetty.  I had no trouble writing in the language, even with its current quirks.

It has entirely too many zero based concepts to be a proper beginners language.  I once had a coworker who had tried a number of times to learn how to program.  I especially remember one concept that he questioned… that of starting with an array index of zero instead of one.

He thought it was more intuitive to have a for(x=1;x<=10;++x){} rather than for(x=0;x<10;++x){}

At the time, I was of the opinion that zero based was somehow “better”.

It isn’t.  Neither way is “better”.  I will state that the more natural “counting” arithmetic would start it with 1.

If I were to make new beginners programming language, I would start with a dialect of BASIC.  I would make arrays 1 based, and string operations 1 based.

In fact, I would probably start with a subset of Color Basic from the TRS-80 CoCo.

I would have two types of data: number and string.

I would have a Goto statement, but I would use labels, not line numbers.

Ditto the Gosub statement

Also, the On.. Goto and On… Gosub, which was the closest thing BASIC had to a switch statement

I would probably incorporate the Sub and Function ideas from QBasic

Graphics and text should be on a 1 based grid, and (1,1) will be in the lower left hand corner, with x and y increasing to the right and upwards.