|
-
Jun 3rd, 2001, 08:35 PM
#1
Thread Starter
Junior Member
vb and c++ differences
I know this is probably a dumb question but, what is the difference between VB and C++? Or..What are the pros and cons of the languages? I've never tried programming a game before, but I'd love to try it.
-
Jun 3rd, 2001, 08:45 PM
#2
New Member
Well, for one thing, Visual Basics was programmed in C++
And C++ is closer to machine code then VB, making it that much better.
Lt Commander Vince
http://www.geocities.com/shorty718 - Just Drums
http://www.canadaclassicrock.com
-
Jun 3rd, 2001, 09:33 PM
#3
-
Jun 3rd, 2001, 10:04 PM
#4
Good Ol' Platypus
Hey stop dissing VB. 
- When making Windows apps (look & feel of windows, etc.) VB is the way to go!
- If you use DirectX for your games, it just doesnt matter if you use VB or C
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 3rd, 2001, 10:43 PM
#5
PowerPoster
In VC++ you can make windows as in VB...
If you're using DirectX in VB you can access a great library *nearly* as fast as in C++... but say you want to make seriuos games you are just lost in VB
-
Jun 4th, 2001, 02:28 PM
#6
New Member
PRO - you can make a VB app. look more like a Windows app.
CON - VB is slower
Lt Commander Vince
http://www.geocities.com/shorty718 - Just Drums
http://www.canadaclassicrock.com
-
Jun 4th, 2001, 02:56 PM
#7
PowerPoster
you can make a VB app. look more like a Windows app.
Erm, windows is made in C, VB is made in C, and Excel and Word and everything other, too...
how come everyone thinks in C you need to make DOS programs or these stupid Borland C++ -buttons with icons and rounded border???
-
Jun 4th, 2001, 03:24 PM
#8
VB is Object Oriented and does have pointers (although you never actually see them =). Defining a variable as say, a TextBox, is really defineing a "Long", and allocating memory for the textbox object. And yes, you can use inheritance, but it sucks =(. Look up "Polymorphism" or something like that in the MSDN for more info.
VB DOES compile to native code, but it relies on several VERY large runtime DLLs for built in functions. VB apps ARE use API calls under the surface, so its much easier to create a GUI really fast. Probably the biggest reason VB is so slow is because MS doesnt have any competition against it, so they have no real reason to spen a lot of time optimizing the VB compiler. VC++ on the other hand, has lots of competition, so they have to make their c++ compiler optimize your code much better. VB also has to make assumptions, for it to hide certain things away from the beginning programmer. You really dont want to see what an "Event" looks like in C++ =).
On the other hand, the way the VB IDE is setup is better in my opinion. The VC++ IDE is kinda shaky when it comes to Intellisense, and that kind of thing.
As was said earlier, VB will get an app up and running, and is quite adequate for most games, but if you really need to get down into the system, C++ is the way to go. It may be a bit more complicated, but it pays off in the long run. And even then, VB is still of much use for creating Map Makers, etc =).
Z.
-
Jun 4th, 2001, 07:01 PM
#9
Thread Starter
Junior Member
This is probably another dumb question...Is it possible to make 3D games? I guess that's what the Direct "3D" is all about...What should I know about, before making vb games?
-
Jun 4th, 2001, 10:54 PM
#10
PowerPoster
Well of course you can make games in VB... but depending on how good they are it's even difficult or impossible in VB. Direct3D is part of the DirectX package and in the meantime it's called DXGraphics (which also contains DDraw, the 2D part of DirectX, now).
-
Jun 8th, 2001, 05:31 AM
#11
Hyperactive Member
3d
With a few good sites, a copy of DirectX8 SDK and 3 weeks, I made myself a 3D program. It lacks some of the maths components though. Eg.. collision detection and Gravity. lol
Visual Basic 6.0 Enterprise
Visual C++ 6.0 Professional
Wak 
-
Jun 8th, 2001, 10:10 AM
#12
-
Jun 8th, 2001, 10:17 AM
#13
PowerPoster
Yeah you can always say 'it's fast enough' - but compared to C/++ it's just slow...
30 FPS is enough, but Quake3 (sorry but I think it has better graphics than yours) runs with 120 FPS on my P800 and that's slightly faster
-
Jun 8th, 2001, 11:45 AM
#14
Frenzied Member
-
Jun 8th, 2001, 11:57 AM
#15
Thread Starter
Junior Member
an example?
can someone send me their stuff? I'd like to see "VB3D" in action hehe
-
Jun 8th, 2001, 04:05 PM
#16
Basically C++ is better for smaller, and faster code (All-Purpose)
VB is good for RAD, and Databases.
-
Jun 8th, 2001, 04:23 PM
#17
Monday Morning Lunatic
C++ is good if you don't want your program to take up nearly 2mb for "Hello World" 
C++ with TINYCRT from Microsoft...no runtime support at all...2K...yeah...
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 10th, 2001, 06:34 AM
#18
Hyperactive Member
heh, i made a c++ program that took up 512kb once, all it said was, I MADE A C++ PROGRAM, WOOOO, and it took up that much, ic an do that in VB and it takes up much less..
assembler, no THATS the language you wanna learn, c++ was made in that!
-
Jun 10th, 2001, 07:03 AM
#19
Monday Morning Lunatic
Ok then.
C++ = 50K program, no dependencies
VB = 10K program, requires 2mb of runtime support files
No contest 
And yeah, ASM kicks everything else but there's little use for it now since it's so hard to program in. It's nice for spot-optimising though
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 10th, 2001, 07:56 AM
#20
Frenzied Member
Your hello world program was probably really big because you were still in debug mode
-
Jun 10th, 2001, 08:18 AM
#21
PowerPoster
It depends on the compiler, ie. MS VC++ makes your program really BIG (compared to others) but compiling doesn't take too much time...
-
Jun 10th, 2001, 08:27 AM
#22
Monday Morning Lunatic
Ummm...the VC++ compiler makes some of the smallest .exes I've seen
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 11th, 2001, 12:26 AM
#23
-
Jun 11th, 2001, 02:32 AM
#24
PowerPoster
I can recommend you 'Visual C++ in 21 days' (german if you want), I also bought it to learn C++ after already knowing VB and it really shows you the important things... it teaches you lot about MFC and C++ in general, but after all you can directly step on to DX coding like in VB..
-
Jun 11th, 2001, 04:04 AM
#25
Monday Morning Lunatic
Don't learn MFC until you're very good at C++. Unlike using the API, MFC demands a considerably higher level of expertise.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 11th, 2001, 09:16 AM
#26
Assembly is not all that hard to read, but you have to know what you are looking at, and exactly what it should be doing.
VB executables are small, VB programs are not. VC++ can create very large executables, but it can also create very small ones. It all depends on your compiler options.
Also i doubt that VC++ was written in Assembly, although it does compile C++ code into assembly language instructions (as do all compilers). VB does the same thing, so the "VB was written in C++ so its slower" argument is invalid.
For myself, I think that if you dont include an FPS counter, as long as it looks smooth, no one will care >=).
Z.
-
Jun 11th, 2001, 10:03 AM
#27
Frenzied Member
Thanks fox for the book thing. I never trusted a 21 day thing. I think I will need a little longer till I could claim to know the language.
and about that:
VB was written in C++ so its slower
that seems pretty funny to me, because it's not like VB is interpreted by C while interpreting its own VB programs . We live in the time of compilers people
Sanity is a full time job
Puh das war harter Stoff!
-
Jun 11th, 2001, 02:08 PM
#28
Frenzied Member
See the FAQ in the C++ forums if you want free online books and tutorials.
-
Jun 11th, 2001, 04:07 PM
#29
Addicted Member
I'm in a similar situation, I was studying VB and now have decided to go to VC++ mainly because of it's power/speed and the fact that I like to create things almost from scratch and like to know how a language like VB is making things so easy.
Most VB programmers don't realise how much VB is doing for them.
What is better to lean first C++ or VC++ I already have two books on VC++ and stated one of them about 4 days ago. Am I right in saying if I lean VC++ I will know C++ properly?
-
Jun 11th, 2001, 04:10 PM
#30
Monday Morning Lunatic
VC++ is a compiler/IDE/project manager
C++ is a language
Therefore, it takes about a day to learn how to use VC++ but a lot longer to use C++.
However, in the case of your books, VC++ would mean MFC
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 11th, 2001, 04:42 PM
#31
Addicted Member
Thanks Parksie, but would leaning the VC++ mean getting a book on C++ later on?
The VC++ Book I'm currently reading was given to me by my Uncle and is:
Visual C++ in 12 Easy Lessons
By Greg Perry & Ian Spencer (SAMS Publishing)
I don't think this book doesn’t get into MFC (I could be wrong), it goes up to OOP and writing text files to disk etc and it's a great book, well so far anyway nicely laid out with definitions and reviews etc.
The second one which I accidentally parched thinks it was for beginners is:
Learn Visual C++ Now
By Mark Andrews (Microsoft Press)
Have you herd off any of these two books or read them? If so what you think of them?
-
Jun 11th, 2001, 05:31 PM
#32
Monday Morning Lunatic
As long as it teaches the language rather than using MFC or the VC++ interface you're okay.
I don't have much experience with books because I learnt C from the K&R book and used MSDN to get up to speed on C++.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 12th, 2001, 09:36 AM
#33
Frenzied Member
30 FPS is enough, but Quake3 (sorry but I think it has better graphics than yours) runs with 120 FPS on my P800 and that's slightly faster
It is not like he would get 120 FPS if he would program his game in C++. I bet those professionals are a little more advanced than what us people here pick up from SDK.
Sanity is a full time job
Puh das war harter Stoff!
-
Jun 12th, 2001, 10:05 AM
#34
Monday Morning Lunatic
Professional game programmers usually have lots of lovely asm in there as well Plus they have knowledge of how to get the most out of a compiler so they're programming in C (sorry, but C beats C++ for speed in a lot of cases) but it looks a little weird because they're cheating and making the branch-prediction work a little better
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 12th, 2001, 11:07 AM
#35
Frenzied Member
Well, I have all the VB-code to make the bounds of the arrays match, so all I need now for my special effects is a really fast DLL that loops trough 2 arrays, checks one against the other in a lookup table (another array), and dumps the result in one of them... it's really easy, I've got the code in VB (5 lines), all I need is someone to convert it to a faster language
-
Jun 12th, 2001, 11:52 AM
#36
Currently, most recent games that are on the market, or are in development, are written in C++. Even thouse C may be faster, and require less memory, the amount of System RAM, the speed of Microprocessors, and the current crop of graphics accelerators on the market make the speed difference almost negligable. C++ offers benefits that far outstrip the tiny bit of extra speed that C offers. Also, contrary to popular belief, modern games dont use near as much inline ASM as people believe. It is used most often for small areas that need to execute at maximum speed, like in nested loops. Even then, the optimization that commercial compilers usually perform is generally far better then what any but an expert ASM programmer could do. The reason most commercial games are so fast is because of rendering techniques use, frustrum culling, back face culling, the various tree methods for occlusion culling (quad trees, oct trees, bsps).
Certainly though, there are games that make use of a lot of ASM. Quake is probably the best example. The original only had software rendering, and the inner rendering loops were re-re-re-re-optimized ASM.
For you C++ programmers out there, here is a neat optimization tip:
Code:
#include <iostream.h>
template <unsigned n> struct Fib
{
enum x
{
val = Fib<n-1>::val + Fib<n-2>::val,
};
};
template <> struct Fib<1> { enum x { val = 1, }; };
template <> struct Fib<0> { enum x { val = 0, }; };
int main()
{
cout << Fib<75>::val << endl;
return 0;
}
This will print the Fibinacci(sp?) value for 75. I know it works in MSVC++6. Try writing a recursive function that does the same thing and compare the results. Its stunning.
Z.
-
Jun 12th, 2001, 12:04 PM
#37
-
Jun 12th, 2001, 02:02 PM
#38
Addicted Member
Hey when you guys say ASM are you talking about Assembly Language, sorry but I'm not familiar with the term ASM and was just wondering.
-
Jun 12th, 2001, 02:04 PM
#39
Monday Morning Lunatic
Yes.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jun 12th, 2001, 04:45 PM
#40
Originally posted by parksie
Professional game programmers usually have lots of lovely asm in there as well Plus they have knowledge of how to get the most out of a compiler so they're programming in C (sorry, but C beats C++ for speed in a lot of cases) but it looks a little weird because they're cheating and making the branch-prediction work a little better
I thought most of the newer games (e.g: 1996 or 1997 and up) used C++ to program the games?
By the way, the industry standard is C, correct? (in contrast to C++)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|