# small basic is out!



## Braveheart (Mar 27, 2009)

microsofts easiest and coolest computer programing language. wow this is soo easy! I've wrote programs in C++, VB, C# and so far my favorite's are C# and small basic, what do you guys think of it?


----------



## lemonadesoda (Mar 27, 2009)

It worries me that there are only "15 keywords". That seems like an awfully small basic to me. However, looking at the User Guide/Introduction it seems that it is really "Object Basic" and with object references there is much more flexibility than just "15 keywords".

If it is easy to use... AND... it introduces object oriented language to the beginner... AND... it is sufficiently similar to BASIC, then great!

However, I'm not really sure about the benefit of this over VB Express.  A very friendly BASIC should allow statements like "PRINT" and "INPUT" and not require object methods identical to VB. If it does... then why not just use VB. Difference? Compiled vs. interpretted?

For anyone that tries it out... please comment... even better, do a very basic algorithm and see how speeds compare between Small Basic and C++ and VB.


----------



## 3870x2 (Mar 27, 2009)

lemonadesoda said:


> It worries me that there are only "15 keywords". That seems like an awfully small basic to me. However, looking at the User Guide/Introduction it seems that it is really "Object Basic" and with object references there is much more flexibility than just "15 keywords".
> 
> If it is easy to use... AND... it introduces object oriented language to the beginner... AND... it is sufficiently similar to BASIC, then great!
> 
> ...



AHH! NERD! jk
I wish i could really get into programming, just doesn't seem like I have the time.  I really liked basic, it helped me learn programming, and I even made a few very fun games with it.
+1 very rare thanks from me, for finding this.


----------



## lemonadesoda (Mar 27, 2009)

3870x2 said:


> AHH! NERD!


Thanks for the compliment!


----------



## 3870x2 (Mar 27, 2009)

lemonadesoda said:


> Thanks for the compliment!



Exactly 
I'm just a wannabe nerd ATM.

There's a lot of things i wannabe: Guitarist, software developer, level 80 human paladin, etc...


----------



## h3llb3nd4 (Mar 27, 2009)

3870x2 said:


> Exactly
> I'm just a wannabe nerd ATM.
> 
> There's a lot of things i wannabe: Guitarist, software developer, level 80 human paladin, etc...



LOL I wannabe a general


----------



## 3870x2 (Mar 27, 2009)

O, but you CAN! smoke a few ounces of HASH and play C&C:Generals!


----------



## h3llb3nd4 (Mar 27, 2009)

LOLz


----------



## 3870x2 (Mar 27, 2009)

Alright guys, Im posting a Small Basic thread!
http://forums.techpowerup.com/showthread.php?p=1283213


----------



## Braveheart (Mar 27, 2009)

3870x2 said:


> Alright guys, Im posting a Small Basic thread!
> http://forums.techpowerup.com/showthread.php?p=1283213



 sweet, this should be fun!


----------



## Kreij (Mar 27, 2009)

The thing that drives me nuts about Small Basic, is that like QBasic there is no varying levels of scope (ie. all variables are global) so you cannot pass variables into subroutines. Makes for lots of spagetti code. 

In any event, I'll put something togther and post it in the other thread.


----------



## 3870x2 (Mar 27, 2009)

sounds great! as we all know, small basic/Qbasic is very basic, but can be fun to toy around with.

Remember that thread can be anything that can be programmed.


----------



## lemonadesoda (Mar 27, 2009)

Kreij said:


> The thing that drives me nuts about Small Basic, is that like QBasic there is no varying levels of scope (ie. all variables are global) so you cannot pass variables into subroutines. Makes for lots of spagetti code.



?confused?

http://library.thinkquest.org/19436/lesson8.htm
http://en.allexperts.com/q/Qbasic-Quickbasic-1623/Passing-user-defined-types.htm
http://www.xs4all.nl/~hwiegman/qb-man/SUB.html


----------



## 3870x2 (Mar 27, 2009)

WHAT!!! is anoyone going to post a challenge? I should have a game and a useful progam up by the end of the day.  If you like the program, THANK THEM, it will kinda count as a vote.  Who knows, there might be some very useful programs coming out of this.


----------



## Braveheart (Mar 27, 2009)

3870x2 said:


> WHAT!!! is anoyone going to post a challenge? I should have a game and a useful progam up by the end of the day.  If you like the program, THANK THEM, it will kinda count as a vote.  Who knows, there might be some very useful programs coming out of this.



im working on it. im working on my blender game at the same time so im not getting a ton done, can't get stupid blender to work


----------



## RevengE (Mar 27, 2009)

3870x2 said:


> Exactly
> I'm just a wannabe nerd ATM.
> 
> There's a lot of things i wannabe: Guitarist, software developer, level 80 human paladin, etc...



I'm a guitarist and a Nerd! It can be done my friend, all you need to do to achieve this goal is 1.spend countless hours staring at your computer. 2.hear your fiancé  yell at you due to the amount of hours you spend Staring at your computer. 3. Play the guitar after your done staring at your computer for countless hours. 4.go to work 5.repeat steps 1-4.


----------



## Braveheart (Mar 27, 2009)

xRevengEx said:


> I'm a guitarist and a Nerd! It can be done my friend, all you need to do to achieve this goal is 1.spend countless hours staring at your computer. 2.hear your fiancé  yell at you due to the amount of hours you spend Staring at your computer. 3. Play the guitar after your done staring at your computer for countless hours. 4.go to work 5.repeat steps 1-4.



so you choose geekness over a wife?


----------



## RevengE (Mar 27, 2009)

no man, I was just kidding


----------



## Kreij (Mar 27, 2009)

lemonadesoda said:


> ?confused?



When you have varying levels of scope it means that when something goes out of scope, anything created inside of the scope gets disposed.

For instance, in C# you can do something like ...

```
int a = 10;
int c = 0;

private int DoSomething (int number)
{
    int b = number * number;
    return b;
}

c = DoSomething(10);
```

This is an extremely simple example.

Since the variable b in created in the scope of the DoSomething method (or subroutine as they are called in Basic), it gets disposed when the method exits. Variable b ONLY exists in the method. It cannot be used from outside of the method.

In Small Basic ALL variables are global and can be used anywhere in the program. Because of this, passing a variable into a subroutine has no meaning, and therefore cannot be done.


----------



## 3870x2 (Mar 27, 2009)

Kreij said:


> When you have varying levels of scope it means that when something goes out of scope, anything created inside of the scope gets disposed.
> 
> For instance, in C# you can do something like ...
> 
> ...


Don't mess with kreij, his avatar is a picture of his daily breakfast.

However, as you see kreij, he meant different types of variables, like floating point, etc....

I am working on my program as we speak, and will post an example of how they should be posted, to make it look neat and clean.


----------



## Kreij (Mar 27, 2009)

3870x2 said:


> Don't mess with kreij, his avatar is a picture of his daily breakfast.
> 
> *However, as you see kreij, he meant different types of variables, like floating point, etc....*
> 
> I am working on my program as we speak, and will post an example of how they should be posted, to make it look neat and clean.



Now I'm ?confused?. Lemonade quoted my post on scope and said he was confused so I explained scope. What does that have to do with variable types?

Anyway, I was working on an enterprise resource planning application all day so I didn't have a chance to play with SB. 
Maybe I can fiddle around with it this weekend at home.


----------



## 3870x2 (Mar 27, 2009)

"(ie. all variables are global) so you cannot pass variables into subroutines"


----------



## Braveheart (Mar 28, 2009)

im almost done with the MS tutorial that came with it and thus almost done with a pretty nice little console calculator.


----------



## 3870x2 (Mar 28, 2009)

Awesome, looking forward to it.


----------



## FordGT90Concept (Mar 28, 2009)

lemonadesoda said:


> For anyone that tries it out... please comment... even better, do a very basic algorithm and see how speeds compare between Small Basic and C++ and VB.


I assume it runs on the .NET framework so the performance is probably the same.




3870x2 said:


> WHAT!!! is anoyone going to post a challenge? I should have a game and a useful progam up by the end of the day.  If you like the program, THANK THEM, it will kinda count as a vote.  Who knows, there might be some very useful programs coming out of this.


I don't code unless I have something to code.  You know, take this 10 step process and make it a 1 step process...


----------



## 3870x2 (Mar 28, 2009)

.... performance? you realize this is basic, right? you need about 500HZ to get maximum performance 
yes it runs on 3.5+


----------



## FordGT90Concept (Mar 28, 2009)

I hope you are joking...


----------



## 3870x2 (Mar 28, 2009)

depends on what.


----------



## FordGT90Concept (Mar 28, 2009)

3870x2 said:


> you need about 500HZ to get maximum performance


It depends entirely on what you are trying to do and how you are trying to do it.


----------



## Kreij (Mar 28, 2009)

Ford has you on this on 3870, from what I've read in the MS SB Forums the performance is not so great. Especially when doing pixel set and get in a GraphicWindow.


----------



## 3870x2 (Mar 28, 2009)

I guarantee you this could run on a pIII w/out a hitch.  Lets talk to u2konline.

SB taxes 50mb itself
The maximum it spiked on playing multipong (wich is about as hefty as this is going to get on any program you SHOULD be making on this, being that it is basic, it isnt meant to be serious for programming, only learning) was about 16% with an average of 8% with 1 core taking up 26mb of ram.

Im not going to start an argument over this, but if this is taxing ANY system, you need to be stepping up to a higher level language


----------



## Kreij (Mar 28, 2009)

Not arguing, 3870, just discussing the various aspects of SB 

Okay, after playing with it for awhile I've come to the conclusion that it is just an exercise in frustration. 
It's a nightmare to accomplish the simplest graphic manipulation due to the non-object oriented type of language that it is.
(Given its .Net nature, I assumed it would have at least minimal OO constructs built in)

For instance, you can create a shape object ...

```
MyRectangle = Shapes.AddRectangle(100, 100)
```
But then you can't do anything from the object itself.

One would think that you would be able to do something like ...

```
MyRectangle.Move(10, 10)
```
But instead you have to pass the object into another class's global method ...

```
Shapes.Move(MyRectangle, 10, 10)
```
.. because the object does not inherit anything from the class that created it.

ARGHHH ... I know, I know it's Basic. But now I remember why I ditched non-OO launguages 20 years ago and taught myself a real OO language 

I would definitely NOT recommend someone who wants to learn how to program, to start with SB. 
It will immediately teach you programming habits that will make the transition to an OO language more difficult than if you just started with one.

I'm going back to playing with C#.


----------



## 3870x2 (Mar 28, 2009)

yeah, ill take your word for it kreij

Either way, remember that you are experienced.  Im only intermediate.  I would recommend this to straight beginners, far before they will start learning OO, and need to get basics down.


----------



## FordGT90Concept (Mar 28, 2009)

So all methods act upon the instance and completely ignore what it is supposed to return as a function?  Example:


```
string = class.ToString()
```

Actually has string being unassigned and class being the string?


----------



## Kreij (Mar 29, 2009)

I'm not sure about all of the classes, FordGT, but in the example I posted it looks like the Shapes class creates an instance of a shape and then just returns some kind of pointer to it. The shape itself, however, does not appear to be a subclass of Shapes, just a variable or structure. Which would explain why you have to feed it back into Shape's global methods (like Move, Rotate, etc) in order to do anything with it.

@3870 : The reason I would not recommend SB is because that's how I learned to program. I had a heck of a time wrapping my head around the ideas of OO (like instantiation, encapsulation, inheritance, etc.) when I moved to a OO language. I think that if someone tries SB and finds that they like programming, they should immediately move to an OO language before they start asking questions like, "How can you possibly write a program without gotos?"


----------



## Braveheart (Mar 29, 2009)

Kreij said:


> I'm not sure about all of the classes, FordGT, but in the example I posted it looks like the Shapes class creates an instance of a shape and then just returns some kind of pointer to it. The shape itself, however, does not appear to be a subclass of Shapes, just a variable or structure. Which would explain why you have to feed it back into Shape's global methods (like Move, Rotate, etc) in order to do anything with it.
> 
> @3870 : The reason I would not recommend SB is because that's how I learned to program. I had a heck of a time wrapping my head around the ideas of OO (like instantiation, encapsulation, inheritance, etc.) when I moved to a OO language. I think that if someone tries SB and finds that they like programming, they should immediately move to an OO language before they start asking questions like, "How can you possibly write a program without gotos?"



...whats an OO language?


----------



## FordGT90Concept (Mar 29, 2009)

Kreij said:


> I'm not sure about all of the classes, FordGT, but in the example I posted it looks like the Shapes class creates an instance of a shape and then just returns some kind of pointer to it. The shape itself, however, does not appear to be a subclass of Shapes, just a variable or structure. Which would explain why you have to feed it back into Shape's global methods (like Move, Rotate, etc) in order to do anything with it.


:shadedshu "basic" my ass 




Braveheart said:


> ...whats an OO language?


Object-Oriented

C++ has some OO features.  Java does too.  C# is an OO language in the truest sense because everything is derived from an "object."


----------



## Braveheart (Mar 30, 2009)

ooh ok, yeah i know what Object Oriented is...just didn't know of its abbrev.


----------



## Braveheart (Apr 11, 2009)

i must be loco...but just to make sure...tell me what what this program does when you run it, cause for me it doesn't start at 1 and goto 25, instead it starts at a 3 digit number and continues till its about 10 digits

```
i = 1
start:
TextWindow.WriteLine(i)
i = i + 1
If (1 < 25) Then
  Goto start
  EndIf
```


----------



## FordGT90Concept (Apr 11, 2009)

```
If ([i][u][b]i[/b][/u][/i] < 25) Then
```
That might be the problem.  Your original code would be an infinite loop.


----------



## Braveheart (Apr 12, 2009)

FordGT90Concept said:


> ```
> If ([i][u][b]i[/b][/u][/i] < 25) Then
> ```
> That might be the problem.  Your original code would be an infinite loop.



why can't i use 1? wouldn't it be the same?


----------



## FordGT90Concept (Apr 12, 2009)

1 < 25 always evaluates to true because 1 is always less than 25.


----------



## Braveheart (Apr 15, 2009)

```
20, i * 15, 180, i * 15
```
 how does this work? what will it equal? im rather confused...


----------



## Gzero (Apr 15, 2009)

Go to maths class  before trying to do a if loop for a counter 

You want it to cycle through 1 to 25, so you need to check that i is greater than 0 and less than 26.

Also does that writeline take a new line each time its called?


----------



## Braveheart (Apr 15, 2009)

Gzero said:


> Go to maths class  before trying to do a if loop for a counter
> 
> You want it to cycle through 1 to 25, so you need to check that i is greater than 0 and less than 26.
> 
> Also does that writeline take a new line each time its called?



 i went to maths class and this wasn't in it. so does it work like this?:
20, i * 15, 180, i * 15=

20 x 1 x 15 = 300

180 x 1 x 15 = 2700

if not i must be missing something...


----------



## Braveheart (Apr 16, 2009)

*my uber sexy program -.0*


```
TextWindow.ForegroundColor = "red"
TextWindow.Write("enter your name: ")
name = TextWindow.Read()
TextWindow.Write("hello " + name + ". ")
begin:
TextWindow.Write("please enter a number to add: ")
num1 = TextWindow.ReadNumber ()
TextWindow.Write ("now, please enter a number to add to the above: ")
num2 = TextWindow.ReadNumber()
num3 = num1 + num2
TextWindow.WriteLine(num3)
Goto begin
```

its da bomb, right!? lol...working on it but for the moment im happy with it.


----------

