🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Future of C++

Started by
65 comments, last by savagerx 22 years, 8 months ago
I can't help but add my two cents.
First of all Java isn't that slow. In fact its pretty fast. A good Jave program is supposedly 10-20% slower than a C++ program. Thats a big deal but only if you making professional games. I seriously doubt that someone making clones of older games or even learning to program a basic 3D engine is going to need the extra speed of C++, especially on a current computer. Who ever said that the Vampire game was written in Java is only half right. The scripting language for Vampire is a derivative of Java but I am fairly certain the actual game was still in C or C++. Furthormore, I ran it on a TNT2 PIII 450 and it ran plenty fast so I find your agrument against Java rather poor. The whole thing about Flash and Java is funny but seriously I think that is a poor comparison and rather pointless because Java and Flash have differnet purposes as I understand it.
In the end I still think that C++ is the language to go with, especially for critical software ( I only add that because the I read a disclaimer somewhere that said not to use Java for mission critical applications a nuclear power plants - seriously)
Just as a side note - isn't Java based on C++? - one would think that syntactly they are about the same then.

I just noticed that I repeated what everyone else said on the second page. Sorry for wasting your time

Dan

Edited by - vTheHero on October 3, 2001 9:12:23 PM
Advertisement
Well I wasn''t going to comment on this being a complete newbie and all, but I thought brand loyalty was only the business of Mcdonalds or the game consoles?

In my opinion the language is only as good as the programmer, me being newbie and all both C++ and Java are crap to me at the moment because I don''t know how to do anything in them.

That said I would say that C++ and Java both have thier uses....
Macros.
Templates.
Multiple Inheritance.
Control. Control. Control.
There''s no substitute for C++.

...
quote:
C++ RTTI only allows you to check types of variables dynamically; not, for example, to call a method dynamically (by this I mean that you won''t know the method name until run-time), or to inspect what attributes an object contains and their types dynamically.

You absolutely can call a unknown method at run-time from C++ - you just need a map of method names to method pointers. If you want unknown parameters, then you need type information about those parameters. This is exactly what the IDispatch interface does. Depending on the level of abstractness you need, you can choose your efficiency.

If you''re doing something like that, you''re probably writing script not code. C++ is a poor choice for script, there''s better tools for that, like VB or html. If you''re writing code, designing and implementing modules that serve a generic purpose C++ is a better choice.

e.g. The TCP/IP driver stack is written in asm, the socket implementation is written in C, the generic client/server application is written in C++ (like a MMOG or web servers and the IE core), and the content they provide is customized scripts.

Java sits at the scripting layer, and reaches into the application layer. C++ sits at the application layer and encompasses the underlying layers. That''s a crucial difference. A level 2 language can dip into level 1, a level 3 can dip into 2 and 1 - but level 4 languages are isolated from their supporting layers for "safety" reasons (anyone else envision a short bus?).

As a language I see Java deficient at the application layer when compared to C++, though it''s inherent portability may be more valuable in certain applications.


Magmai Kai Holmlor
- Not For Rent
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
UNIX will be around for years to come, and so will C, because all great achievements don''t get thrown out when something flashier comes along.
I just wanted to make a few points here.
First off, Java is a really nice language for *some tasks* (including server-side applications for web-servers). The fact that Java is slower (not so much so as it used to be, but still) than C/C++, and is likely to remain so forever, means that no matter how good it is it will not take over from C and C++ in applications that demand high speeds (such as games, device-drivers, etc.).
Also, although it has already been pointed out by someone else, Java *does* have pointers. What is doesn''t have is *pointer arithmetics*, which is quite something else.
I have worked with Java in a professional situation, and I can say wholeheartedly that it would have been a royal pain in the ass to implement what we did in C++. I shudder at the mere thought.
That said, for my own programs (which are usually grahpics-oriented) I stick with C++.

-Neophyte

- Death awaits you all with nasty, big, pointy teeth. -
Do I sense an anti-java bias here?

Anyone heard of dynamic compiling? The fact that java is run in a VM may actually be a strength. Unlike C++, whose compiled programs runs natively on the CPU with very little hope of run-time optimizations, java hot-spot technologies allow code to be optimized at RUN-TIME, meaning java code can potentially be FASTER than native apps. This still pretty new stuff, and I''m no java expert, but I think people should fully investigate the POTENTIAL of java as a viable performance language before they start flaming it just because their little 100-line java program didn''t run as fast as their 1000-line C++ program. Sure, it''s not there yet, but who knows...Quake V written in java???
If control is the only reason you are favouring C++ over Java, then why not switch to straight out ASM?

You have plently more power in ASM. And if C++ has that because it can do inline ASM, then what about all those other languages with inline ASM?

Trying is the first step towards failure.
Trying is the first step towards failure.
I think we should all program directly in binary with little tiny switches.

"A society without religion is like a crazed psychopath without a loaded .45"
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by davidko
The fact that java is run in a VM may actually be a strength. Unlike C++, whose compiled programs runs natively on the CPU with very little hope of run-time optimizations, java hot-spot technologies allow code to be optimized at RUN-TIME, meaning java code can potentially be FASTER than native apps.


Ever think that the VM is written in C/C++? The Java VM needs to run along with the Java code, using up more cpu time than what a pure C/C++ app would use, causing the Java app to be slower. That along with all the conversion stuffs that go on internally within a VM, theres a good chunk of cpu time spent doing repetative VM work for converting Java code to be executed.
-----------------------"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else's drivers, I assume it is their fault" - John Carmack
I just wanted to toss http://jcp.org/jsr/detail/134.jsp in here, to check out for all the Java naysayers and doubters (and all the Java fans who have not looked at it before too, of course).
Sorry if someone else already put up that link, but I did not see it in any of the posts above.

This topic is closed to new replies.

Advertisement