#### Archived

This topic is now archived and is closed to further replies.

This topic is 5285 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have decided to sign up for a Visual Basic programming class at my high school. I did it expecting to get a “taste” of what Visual C and C++ programming would be like, but a friend of mine says Basic is nowhere near what C and C++ involves. Your thoughts?

##### Share on other sites
C and C++ are quite different from Visual Basic in terms of syntax, paradigms, capabilities, and complexity. You still might find the class useful as an introduction to programming, especially if you''re a complete newbie.

##### Share on other sites
quote:
Original post by DaTroof
especially if you''re a complete newbie.

That certainly describes me. BTW, could you show me a few lines of Basic and a few lines of C++? Also, are a lot of the terms you learn doing Basic cared over when learning C++?

##### Share on other sites
Basic is exactly what it is...basic. That''s why they named it that I guess. C++ is one of the more complex languages. I''ve never done basic but I am a C++ programmer so here is a small program that adds two numbers in C++ just to show you what it looks like:

#include <iostream>int main(){  int a = 7;  int b = 6;  int c = (a + b);  std::cout << "a: " << a << " b: " << b << std::endl;  std::cout << "c: " << c << std::endl;  return 0;}

What that does is it just prints out a, b, and c.

There''s no town drunk here, we all take turns.
Velocity Gaming Force

##### Share on other sites
Similar Code, in VB .Net (Note some things you'll see here aren't allowed in vb6 - I don't know which version is taught in your school)

Module Module1   Sub Main      dim a as integer = 7      dim b as integer = 6      dim c as integer = (a + b)      Console.Writeline("a: " & a & " b: " & b)      Console.Writeline("c: " & c )      return 0   End SubEnd Module

C++ is a languages that has features like memory management, pointer manipulation and templates that make it extremely powerfull, but in fairness also extremely easy to mess up
VB is a language designed on a perspective of fast development - its syntax is supposed to facilitate background compilation, for example (basically the IDE gives warnings that something is incorrect as soon as you finish typing a line vs when you compile a program in C++)

In the end, though, visual basic (and if that course is for vb6 double these conclusions) is a bit different that C/C++ - if your objective is to learn these languages and you have no interest in VB for itself, you would be better off just jumping on them - it's not that what you learn while coding in vb won't help - you're just softnening the learning curve, which means that it'll take you longer before you start learning C++, since you probably won't pick it up until you've finish that course.

"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura

[edited by - alexmoura on July 27, 2003 2:37:15 PM]

##### Share on other sites
Heres a C++ and VB6 example

VB:
Private Function SomeFunctionName() As Single    Dim Sum As Single    Dim i As long''    For i = 0 To 10        Sum = Sum + 0.5    Next''    SomeFunctionName = SumEnd Function

C++
float SomeFunctionName(void){    float Sum;//    for(long i = 0; i < 10; i++)    {        Sum += 0.5f;    }//    return Sum;}

-UltimaX-

"You wished for a white christmas... Now go shovel your wishes!"

##### Share on other sites
So Alex, what you are say is that learning VB will make it a little easier to learn C++, but at the same time it is quicker to just go ahead and do C++. My school doesn''t offer C++, and like I said I just want to get a taste of programming, period, before I decide if I want to take that path. In sort, I am trying to avoid putting all my eggs in one basket.

I guess the better question is: If VB puts a bad taste in my mouth in high school, should I even consider other types of programming in college?

##### Share on other sites
You have about a month id guess. Get a vb book today, and make a simple program, get your ass out of that class, trust me. You will learn nothing. I tested out of the class so i could go to the level2 class which was c++ (its funny how the differnt levels are really difernt languages). Compared to my class i am a c++ god. My teacher could not figure out classes and so we didn''t learn them, we didn''t even learn pointers! I told him they were just liek classes in vb and he said that they dindt'' teach classes. So if your teacher is anythign like mine, it would be better to stay out of the classes (school classes) all together. Get a book, move at your own speed.

##### Share on other sites
VB is pretty easy and will teach you ''programming'' although you may pick up some bad habits before you start learning a powerful language like C++. So, I''d jump straight into c++ (maybe stick to DOS c++ first).

##### Share on other sites
Basic is easy, too easy for someone who can ype and post threads in GameDev.net You can have a go at it, but I suggest just as an appetiser to see what programming is about. You should quickly forget about it and move on to C++ (which might or might not be easier than C). So doing a course on Basic.... You can use the time to learn C++ yourself, but you will need some guidance as it can be quite tricky. See if the teacher is any good and can help you out. He might see it as a strange request though, if you snob his precious Visual Basic class at the same time.

C has some nasty quirks, that you really need to understand, like pointers, references, and dynamic memory. They are scary at first, and it would take you at least a month to fully understand them (and don''t get mangled up in references and pointers of pointers of a pointer of a struct ).

here is a list of what C/C++ has to offer and what you should know. I recon it would take you about 6 months of decent teaching (or with a couple of books) to understand all these.

header files and libraries, functions, parameters, basic data types (strings, chars, int, float, bool) and structs, forward declaration of variables and functions(), numerical operators and logical operators, if/else, switch/case, do/while/for expressions, function parameters, dynamic memory versus static memory, pointers, multiple dimensions of arrays (easier than it sounds) passing by value versus passing by reference or pointer, the stack and heap, standard libraries, inheritance, member functions, private/public/protected, classes, bitfields, basic OO design (very important to at least get the grasp of it), ...

Go to C++ straight away. You kids are so darn clever with computers nowadays. Back in my time, basic and Pascal was the shit, now I guess it''s C++. Teachers are a few decades behind, they should really teach kids the proper stuff, like C++. They always take them for retards. I knew more about basic than my teacher after a month.

##### Share on other sites
quote:
Original post by Varium
So Alex, what you are say is that learning VB will make it a little easier to learn C++, but at the same time it is quicker to just go ahead and do C++. My school doesn't offer C++, and like I said I just want to get a taste of programming, period, before I decide if I want to take that path. In sort, I am trying to avoid putting all my eggs in one basket.

I guess the better question is: If VB puts a bad taste in my mouth in high school, should I even consider other types of programming in college?

Argh, tough question - what follows is just an opinion - take it with a grain of salt.
I think it depends on your personality - if you are someone who's been dealing with logic, is pretty good at maths, there is a chance that this lesson will end up being boring to you - the basis of programming are relatively simple, and you may end up not enjoing programming if the class is too basic - if feel that starting to happen, grab a VB book, or choose a chalenging project and start learning for yourself (help in Visual studio has pretty much all you need to learn to program - the devil is in finding it ). If however you just don't like the whole point of constant problem solving that comes with programming, then you may want to reconsider programming as a career option.
One funny detail - I've never met a person who didn't like the first language he/she started programming in - most of the people you'll see complaining about a language are either forced to use it or don't really know it.

In any case, you for any reason you do find yourself not enjoying the class, it could be vb's fault - I would suggest at that point giving another language a try - C++ if you want a challenge, java/C# if you just don't like the syntax, or even VB .Net if it's the IDE that's getting on your nerves (advanced advice - the thing I used to hate the most about vb6 - it pops up a message box that you have to close each time there is an error in a line - is actually configurable; fgures I'd learn that long after I stopped using vb6)

Quick advice for vb6 - get option strict allways on...

 - one more thing - I would recomend in any case that on the long term you do learn C/C++ and or a bit of assembly - even if you end up not using these languages the insight they give on computer architecture is unvaluable in the long run

"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura

[edited by - alexmoura on July 27, 2003 9:44:16 PM]

##### Share on other sites
Well, if the class is too easy for me, at least I will earn an easy A. If not, then I may learn something valuable that I have overlooked. Either way it is a win-win situation. I am thinking about applying for Digipen, so having some type of programming in high school would look good on the application, right?

##### Share on other sites
To be honest, I don't know
From a personal development point of view, I'd say it would be well worth it - for a professional games development point of view, I would still say yes, but I've met a lot of people who have preconceptions against Visual Basic - and I would have to admit that at one point I was one of them - myself, even back then I would have thought that knowing VB was still a lot better than not knowing programming at all, but I don't know who'll be reading your resume...
The thing is, in all likelihood, the classes at Digipen will be in C++/assembly.
What I would suggest one again, is to take the course, and after you've picked up the essencials, start studying C/C++ on your own - focusing on the syntax differences from vb for the basics first (method and variable declarations, operators, flow control operators), then fully undestanding pointers and string manipulation (if you are having problems understanding them, ask here in gamedev - getting a description of how a processor actually uses them typically clears people on how they actually work, but most books won't get that deep), memory management, then Classes and associated OO features, then templates and the stl...

Even if you only get past pointers/memory allocation, that's enought to state that you have some knowledge of C++ in your application - believe it or not I think that's probably 98% of the C++ (technically you could argue that's really only C) you'll use in games

"I woke up sweating and clutching my pillow. Thankfully the powerful and reassuring visage of Optimus Prime staring back at me from my pillow case served to ease my frayed nerves. Like the giant robotic father I never had he always knows just what to say" - Gabe, Penny-Arcade

Alexandre Moura

[edited by - alexmoura on July 29, 2003 2:06:39 PM]

##### Share on other sites
I think noone should answer the post topic if they dont know anything about VisualBasic.
VB is not a language, its a RAD tool (rapid application development). So its interpreted and cant be as fast code as c++ (c# has the same fault too, but thats another topic).

If you want to make a game or engine that won''t be cutting edge then you can use visual basic (use it with DirectX of course, VB and OpenGL arent good friends ). But if you want to make a decent engine/game you HAVE to choose c/c++.

As a RAD, visual basic doesnt have the capabilities of memory managment at the same level as C-brand has. Maybe all this has changed with VB .NET, i know you can now code classes and use inheritance and all this. But .NET code (C# or VB.NET) is not as fast as c++ code (i''ve read tests that show c# code is 80% slower than c++ code; if someone knows about it, please post it)

##### Share on other sites
quote:
Original post by Ekim_Gram
Basic is exactly what it is...basic. That''s why they named it that I guess.

Guess again It stands for Beginners All-purpose Symbolic Instruction Code.

##### Share on other sites
quote:
Original post by tiutiu
...So its interpreted and cant be as fast code as c++...

What are you trying to imply there? That VB doesn't produce binaries or what? Sure seems like what you are trying to say. Bleh

and then you previously state this:

quote:
Original post by tiutiu
I think noone should answer the post topic if they dont know anything about VisualBasic.

LOLs!

quote:
Original post by tiutiu
VB is not a language...

What the hell are you smoking? Scripting can also be considered a language, just a really high level version of it, VB is lower level compared to that and it most certainly is a language nonetheless. Its like you're trying to say "Theres c/c++" and everything else is not a language. I don't know where you're from but they must have some real potent stuff that people snort. LMFAO!

[edited by - nervo on July 30, 2003 5:36:40 AM]

##### Share on other sites
Tricky question..while VB might give you a taste of programming, it migth encourage "sloppy" coding style. I''ve seen people who begun writing VB, then moved over to C/C++, some of them have a very hard time grasping the more restricted syntax, they also have more problem understanding how programs are structured. If you on the other hand learn C/C++ or Java, you''ll probably not have any problem moving over to VB (other than the strange fact that you aren''t allowed to use paranthesis around function arguments if you''re not using the return value, I just don''t GET it ). VB will also severly limit you when you get to more advanced topics, in the application I''m currently writing (which I really should be working at instead of writing meaningless posts on GameDev), I''ve had to import a whole bunch of C functions just to be able to get the functionallity I need.

Ah well, to sum it up. VB might be good for a taste of programming as long as you don''t get stuck in it, but I think it''s more worthwile learning C/C++, or if you want a little higher level language, Java (which is really nice IMHO)

Oh, one last thing, I''ve gotten quite sceptical against VB classes after attending one where they''d put a WebDesign teacher with a "Learn VB in 24 hours or something" book as VB teacher...I ended up correcting his code for him..But if you''re more lucky than me and get a good teacher on the other hand..it migth be more worthwhile

-Luctus

Statisticly seen, most things happens to other people.
[Mail]

##### Share on other sites
I''m a developer who has been using (various versions of )VB for 8 or so years now and I''m coding a simple game using C++ / OpenGL in my spare time.

Ask yourself why you want to learn the language? For fun? as a career?

If you want to get a taste of what C/C++ is like then I''d suggest learning those languages as the syntax is totally different to VB and lots of the techniques differ too.

You don''t have to worry about memory leaks in VB (apart from external circular references), etc and it protects you from a lot of the traps of C++.

VB gets a lot of bad press, some of which I agree with, some of it complete rubbish. Sloppy programming is one. There is no language out there that protects you from sloppy programming.

The .NET incarnation is now considered a full OO language after gaining proper inheritance and has matured a LOT (structured error handling - woohoo!). A lot of people (ex MS staff, MVPs consider it different enough to warrant it having another name). So beware if you start at v6 and look to migrate to .NET.

Remember the language is just a tool to solve a problem. Pick the best one for the job. As someone said on here ''If the only tool you have is a hammer all your problems look like nails'' or something like that!

Cheers,
Paul Cunningham

##### Share on other sites
My first programming experience was with VB, and when converting to C++ I did have some problems, most of which are due to my roots in VB.

VB does make you code more sloppily, or rather it makes it easier to code sloppily (is sloppily even a word? ).

VB I feel is a very good intro to coding because it has a very shallow learning curve to start with. With very little code you can do quite a lot. However, when you get into the more advanced stuff VB gets a lot more tedious. It just doesn''t seem to scale well because all the stuff that make it easier, also make it harder to perform advanced tasks. VB is also noticably slower, but I think thats not just the compiler, and the constant data type conversions, but a poor message loop as well.

As PaulCunningham, use the best language for the job. I found VB is extremely good at making supporting programs for a larger project. For example if coding a game, VB make it easy to make a simple level editor. Level editors don''t need to be fast, but they do need to be easy to use, and quick to build (people don''t ''play'' the level editor, but they do ''play'' with the game, so the game deserves the most coding time).

Just make sure you don''t take all of VB''s features for granted, and don''t start getting into bad practice (ugh @ VB and its use of Goto when handling errors) and you''ll be fine. I just hope your teacher is actually a good one. It seems all the best programmers are employed, and the worst end up in education The exception are the few good programmers who enjoy teaching.

##### Share on other sites
First off I suggest you ignore most of these posts as they are too close-minded. ANY language that you learn will give you a better knowledge of programming, and the more languages you know the better. I started with qBasic in high school, then in college i was first taught C++, which came VERY easy since i aready understood the basic concepts of programming from QBasic even though the languages are completely different. Then i was taught Java, then Visual Basic, then some more Java, then some Perl, then some PHP (if you guys count this, i do). And next semester I am taking a class on Lisp and other not so popular languages. What i am saying is that those who say not to learn VB because c++ is better or morons and you should disregard their opinions. Once you learn one language it is pretty simple to learn the others as they all have common principles (like variables and data types and bubble sort ).

So i would definatly take the class, Visual Basic is great to start with because you can actually get a Windows program up and running in seconds (literally). If you start with c++ you may be turned off of programming because you will only (initially) be taught how to write simple dos console programs. I enjoyed my QBaisc class much more then my c++ class because at the end of my high school QBasic class i had actually written a simple graphical game (writing a game was our final project), whereas at the end of my comp sci 1 class(c++). I only had dos text program that would save addresses in a file.

So that said, taking a class in any/all languages available is a good idea IMHO. Just keep this in mind... your high school teacher probably went to college for education, not computer science, therefore dont get your panties in a bunch like honayboyz because your teacher isnt a professional programmer.

Also remember you can buy a c++ book and learn both languages side by side to reinforce you knowledge of programming in general.