PDA

Click to See Complete Forum and Search --> : Visual C++ VS. Visual Basic!!


TupacShakur
Mar 11th, 2002, 08:38 AM
I'm new to Programming, C++ and Visual Basic.
This is my first year in college as a Computer Scientist and am looking forward to becoming a GOOD Programmer in many different Computer Languages.
Till now, we only make DOS based programs in C++, with no Interface or "Windows Look". I heard that is Visual Basic is more powerful, and that we can create programs more easily.
Is that true? And can every program be written in both C++ and VB? Which is easier? Which is more efficient? Is there any interface in C++ programming? What about classes in C++????

Please, Help!!!

Thanx...

Zaei
Mar 11th, 2002, 09:03 AM
Though VB can create SIMPLE programs faster, though it is far less powerful then C++. If you are looking to create complex systems, C++ is the obvious choice. It is based around classes, while VB has only rudimentary Object Orientation. A good C++ programmer can create far more efficient code, while a good VB programmer is limited by the language itself (VB is slow).

If you want to create and actual GUI, you have to get into API programming, since everything is usually done in code.

Z.

HaxSoft
Mar 14th, 2002, 11:35 PM
C and C++ leaves everything up to YOU. Therefore it is a good language for highly organized programmers that spend 50% of their time planning, 20% of their time coding, and 30% of their time testing.

For the 5%-planning programmer, use VB -- C++ needs to be taken seriously. Because C++ gives you all the control in the world, you are bound to make mistakes unless you know your way around.

More control means more responsibility. If you wanna code your app as you think out new ideas, you MUST use VB -- otherwise you will simply end up with an unfinished app.

Either way -- you can always write one component in C and the other in VB. No problem. Only an idiot would limit himself to a single language.

parksie
Mar 15th, 2002, 10:00 AM
Agreed.

It's a fairly common thing for people to do - write the interface in VB, and that calls on DLLs written in C, or C++, or any language for that matter (for example there's a vbasm.dll floating around the internet that does some cool things).

made_of_asp
Mar 15th, 2002, 05:55 PM
Visual Basic is pretty simple compared to VC++ as you simply drag the items to the forms.

If you learm VB for two years it's gonna be hard to try doing the same using API in C++.

I also mentioned that if the VB program's interface is large, your program might have very hard time booting up.

nabeels786
Mar 15th, 2002, 08:30 PM
Originally posted by parksie
Agreed.

It's a fairly common thing for people to do - write the interface in VB, and that calls on DLLs written in C, or C++, or any language for that matter (for example there's a vbasm.dll floating around the internet that does some cool things).


thats what i do, i just do an interface in VB then do the code via DLLs in C++. yeah its not the best way, but until im comfortable with the api in vc, then ill do it that way

GOBI
Mar 15th, 2002, 09:13 PM
Dun worry , wan u master ur C++ , u will haf a chance on MFC ,which will have the "Windows look".
Althought Visual Basic is easy to master,but VB is a single thread programming language(i think so.) , unlike C++ which allows u to handle mutliple threads.and C++ is like the rest say must more efficient then vb.

To do a interface with c++ , u have to learn mfc..

sail3005
Mar 15th, 2002, 09:35 PM
i think the API is better for windows than MFC..mfc uses runtimes.

CaptainPinko
Mar 15th, 2002, 10:34 PM
or you could just use Java! it has easy to code GUI, you can get IDE that allow you to drag-n-drop design and is really similar to C++ without GOD FORSAKEN MICRO$OFT . plus, its 100% object-oriented and platform independent.

well i just thought you'd all want some common sense =D and a fresh perspective

Zaei
Mar 16th, 2002, 12:07 AM
Microsoft does not own C++. C++ is a language. Microsoft simply publishes a compiler/IDE package that is quite popular, for reasons of high quality and ease of use.

Java also has a really crappy GUI creation API(Swing), that, from my experience is pretty choppy at best. C++ can, of course, use the windows API, or any other operating system's API for window creation.

Z.

parksie
Mar 16th, 2002, 04:31 AM
Be nice about Swing, it's pretty cool actually.

The main problem with using it in Java was that it was immensely slow - but that's changed with the introduction of HotSpot (not just a JIT, it actually dynamically optimises and performs all the register allocation tasks normal compilers would do).

GOBI - if you need MFC to make a Windows interface, how do you think they wrote Windows? :p The API is a load of C functions for every task imaginable, and MFC is just a wrapper.

In many cases, there are alternatives to MFC that are better in many ways, for example wxWindows (looks like MFC, but runs on pretty much anything).

And when I get my sodding compiler back, I might continue with my efforts :D

Zaei
Mar 16th, 2002, 11:04 AM
So HotSpot is similar to the .NET JIT, except to platform independant object code, instead of native code? That is pretty cool. I wonder if there is something like that for C++.

Z.

parksie
Mar 16th, 2002, 11:08 AM
Well, it does the same as any other JIT, it's just a lot more sophisticated in the way it does things (inlining, anyone? :)).

As far as C++ goes, the .NET one should take care of that if the POSIX port goes anywhere...

I'm not aware of any current technology that can compile C++ to bytecode and do a JIT on any platform, so far, since C++ code is by nature platform-specific.

CaptainPinko
Mar 17th, 2002, 05:31 PM
Originally posted by Zaei
I wonder if there is something like that for C++.

why even bother w/ c++ nemore? what does it have that java doesn't? (most of the things that are missing were removed because they impeded cross-platformness)

parksie
Mar 17th, 2002, 06:22 PM
Originally posted by CaptainPinko
why even bother w/ c++ nemore? what does it have that java doesn't? (most of the things that are missing were removed because they impeded cross-platformness) For one thing, C++ works on pretty much ANYTHING.

Plus, since when has Java had templates? :D And also, C++ isn't easy to beat for a HLL as far as performance goes.

made_of_asp
Mar 17th, 2002, 09:57 PM
C++ beats Java because it is faster and for me it is easier to use.

Are there conversions in Java ( (_b_str_(char*)x))?

Zaei
Mar 17th, 2002, 10:13 PM
Why? Because I can do THIS in C++ >=):

void swap(int& a, int& b) {
int temp = a;
a = b;
b = a;
}

Or, even better...

template<class t> void swap(t& a, t& b) {
t temp = a;
a = b;
b = a;
}


And of course, because Java is a scripting language =).

Z.

parksie
Mar 18th, 2002, 03:23 AM
Originally posted by Zaei
And of course, because Java is a scripting language =).Not anymore ;-)

I don't know whether I mentioned HotSpot already to you in any thread (I've said it about twice to different people), but that can get Java code running nearly as fast as compiled VB (so about 80% C++ speed).

Zaei
Mar 18th, 2002, 08:31 AM
You did, but it changes nothing =).

Z.