About Visual Basic

Started by
18 comments, last by Varium 20 years, 8 months ago
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?
Superbitch Must Die!!!!!!!!!!!
Advertisement
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.
Post Extant Graphical MUD
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++?


Superbitch Must Die!!!!!!!!!!!
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
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]
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!"
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?
Superbitch Must Die!!!!!!!!!!!
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.
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).
lol
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.

Everything is better with Metal.

This topic is closed to new replies.

Advertisement