PDA

View Full Version : BASIC vs. Qbasic



Jperensky
12-07-2002, 10:04 PM
I have been playing with BASIC and Qbasic and I can't tell what the difference is.

Is it like the difference between C and C++, all of the C elements will work in C++ but there is more you can do (all BASIC will work in Qbasic)?

Thanks For The Help!

tim545666
12-07-2002, 10:13 PM
Qbasic = Microsoft's version of BASIC. I never learned BASIC, but I think the code is close to identical. That being said, those languages are both worthless and you're wasting your time learning them.

sean
12-07-2002, 10:27 PM
Actually QBasic is just an interpreter for BASIC. If you get one of the more recent versions of QBasic that actually compile *.exe files, I actually don't think it's a waste of time. It's really useful for learning the basics of programming and making simple utilities.

DavidP
12-07-2002, 11:25 PM
BASIC is a language, QBasic is a compiler.

It is not like the difference between C and C++ at all. It is more like the difference between Borland C++ and C++, or MS Visual C++ and C++. One is a compiler for the language, one is the actual language.

There are many other BASIC compilers, such as:

FirstBasic
PowerBasic
GamesBasic
DarkBasic
Visual Basic (yes, this is a BASIC compiler, not its own language)

It is not a waste of time to learn BASIC. Visual Basic is still a very common compiler used in the business world for corporate functions, and if you plan on going into that field, you will use it a whole lot.

Most of the other compilers are not in general use in the professional world, but it would still be good to learn BASIC because it is an easy to learn language that can help you to learn some of the fundementals of programming and can lead you into C and C++.

ammar
12-08-2002, 04:12 AM
Although I don't like this language, I don't consider it a waste of time, because you make simple things without much effort.
And it's good to teach young people programming with BASIC so they can understand the basic concepts of progamming.

face_master
12-08-2002, 04:41 AM
I dont know why everybody says this! I learnt C++ with no knowlege of what programming was!! (I didn't know about compilers, etc..). The concepts are the same, so why learn them along with a crap lang?

Shiro
12-08-2002, 07:59 AM
BASIC is a language for which a lot of interpreters were created, like GW-Basic. Also MS-DOS versions came with basic, I can remember that MS-DOS 5.0 came with the first QBasic interpreter. This was a BASIC interpreter with an IDE which looked a lot like MS-Edit. There were also BASIC compilers, like QuickBasic.

BASIC is a very easy language and one can easily make a usefull tool with it. Because it is so easy to use, it can be used to make people enthousiastic for programming. They can, with little effort, create a piece of software which works. Such small things can motivate people to learn more about programming.

A disadvantage of BASIC is that it is also easy to learn bad programming habits like using GOTO. However, the language as I remember from long ago also supported SUB-procedures.

Some people are really motivated to learn programming and start with languages like C or Pascal. Others don't know if they really like it, they think programming is too difficult for them. Programming in BASIC would show those people that it can also be easy and above all: fun. As they gain more knowledge and experience, they probably also learn more about programming theory and other languages like C and C++.

As I understood from some reading on the internet, BASIC is not only used for learning people programming, but it seems also being used in professional applications, mainly Visual Basic.

Sang-drax
12-08-2002, 08:36 AM
Originally posted by Shiro
They can, with little effort, create a piece of software which works.
Is it that much harder to do that in C++?
No, forget BASIC because it gives you bad habits.

Shiro
12-08-2002, 08:51 AM
>Is it that much harder to do that in C++?

For some people, yes.

>No, forget BASIC because it gives you bad habits.

It _can_ give you bad habits. Also in other languages programmers can develop bad habits. Like C-programmers who write enormous functions instead of splitting them up in smaller functions, people misusing pointers because they don't understand them, and many more of such things.

And what about void main().

valar_king
12-08-2002, 09:52 AM
QBasic is different from BASIC. Just like Visual C++ is different from C++. Thought QBasic does away with things like line numbers. It adds better input, output functions. It adds better subroutine and function support. QBasic is much better than plain BASIC.

Though it's like comparing one pile of dog crap to another.

sean
12-08-2002, 09:58 AM
lol - Good one. But still, that makes excellent fertilizer.

DavidP
12-08-2002, 10:20 PM
Is it that much harder to do that in C++?


Well why dont you take a look for yourself?

C++:


#include <iostream.h>
#include <conio.h>

int main ( void )
{
cout << "Hello, World!" << endl;
getch();
return 0;
}


BASIC:


PRINT "Hello, World!"

Terrancee
12-09-2002, 12:09 PM
Originally posted by DavidP
Well why dont you take a look for yourself?

C++:


#include <iostream.h>
#include <conio.h>

int main ( void )
{
cout << "Hello, World!" << endl;
getch();
return 0;
}


BASIC:


PRINT "Hello, World!"


Not a good example of why c++ is a tougher language than basic.

c++ incorporates a lot of rules and theories that make it much more difficult to learn and implement than other languages.

Basic was a programming language designed for non programmers to learn programming relatively quickly and allow them to write small applications.

qbasic is a compiler, opposed to basic- a language, but qbasic is modified from the original basic. Qbasic was meant to be a simplified version of basic, invented by Bill Gates and Paul Allen (just wanted to add that)!

Liberty basic ( www.libertybasic.com ) is very similar to qbasic, and it has an IDE. You might want to check it out.

Terrancee
12-09-2002, 12:16 PM
And visual basic is a language, just like vb.net.

vb scripting is also a language by itself.

Anyone would consider vb a language in itself!

dirkduck
12-09-2002, 06:23 PM
" No endl needed because the BASIC script doesn't print one either (I think). "

Try
PRINT "line 1"
PRINT "next line"

The second print will show up a line below the first. Need the endl or \n for that in C++. Personally I think BASIC is great :).

DavidP
12-09-2002, 11:34 PM
No return 0 needed because C++ implicitly returns 0.


You sure you want to say that on this board? There are quite a few of "int main" buffs on this board who insist on having an int main function and the return. Besides, I dont know what compiler you use, but not putting the return 0 will give you errors and/or warnings in every single compiler I have used, so it is needed unless you are using a void main, which is not the correct way to do things.



getch( ) is both non-standard and not needed


I have used about 6 different C++ compilers and have yet to find one that does not support getch().



iostream.h isn't supported by the standard anymore, make that iostream


Not all compilers follow that standard. Also, several times iostream and iostream.h are two completely different things. For example, one time I was using the standard vector class (vector.h) in a program of mine, and decided to just tell it to include vector instead of vector.h. Well when I did that I ended getting many errors. I opened up vector, and I opened up vector.h, and they were two totally different files...vector.h turned out to be the updated one, vector was just an old junked up version that was out of date. I then looked at iostream and iostream.h, and the same case occurred there.

I like placing the .h on mine. In my opinion it is the proper way. It states that it is a header file. Putting no extension leaves so amount of obscureness and uneasiness in me. I have yet to hear that iostream.h is not standard anymore.



No endl needed because the BASIC script doesn't print one either (I think).


Oh yes it does...go try it. :p



getch( ) is both non-standard and not needed


I know I already addressed this one...but I wanted to say one more thing about it. Not needed? What makes you think it is not needed? It would do you very much good to use it. I know some compilers (like M$ VC++) automatically wait for a keypress at the end of console programs to close down the console program, and therefore the getch at the end of the program is not needed, but the majority of compilers, from what I have seen, do not do that. Therefore to prevent the compiler from building, running, and closing your application almost simultaneously (this is in the case of a simple console app like this one, I am not talking about more complicated apps), you need the getch to be able to make it stop and wait for a key press and the end of the program before it shuts down the console window.

Monster
12-10-2002, 04:21 AM
Originally posted by DavidP
You sure you want to say that on this board? There are quite a few of "int main" buffs on this board who insist on having an int main function and the return. Besides, I dont know what compiler you use, but not putting the return 0 will give you errors and/or warnings in every single compiler I have used, so it is needed unless you are using a void main, which is not the correct way to do things.

Sorry to say DavidP but vVv is right about this. In C you need to return a value but C++ implicitly returns 0.

Bjarne Stroustrup's C++ Style and Technique FAQ (http://www.research.att.com/~bs/bs_faq2.html#void-main)

VegasSte
12-10-2002, 04:29 AM
I always thought basic was fun:



10 PRINT "I AM GOD!!"
20 goto 10


Which amusingly prints I AM GOD!! all down the screen to infinity and beyond!!

ammar
12-10-2002, 07:31 AM
Originally posted by Monster
Sorry to say DavidP but vVv is right about this. In C you need to return a value but C++ implicitly returns 0.

Bjarne Stroustrup's C++ Style and Technique FAQ (http://www.research.att.com/~bs/bs_faq2.html#void-main)

That website is great I found out many new things on it, I recommend that you all read it.

valar_king
12-10-2002, 09:13 AM
Originally posted by dirkduck
" No endl needed because the BASIC script doesn't print one either (I think). "

Try
PRINT "line 1"
PRINT "next line"

The second print will show up a line below the first. Need the endl or \n for that in C++. Personally I think BASIC is great :).

Yes, but what do you do if you want to do some calculations, then print more on the same line? It happened to me, and triggered my permenant change to C++