Advertisement

What are the strong points of each language?

Started by December 10, 2002 09:52 AM
17 comments, last by smiley4 21 years, 11 months ago
This will probably degenerate into bigotry and ''holy wars'' within the next few hours. I''m a C++ programmer first and foremost, but to suggest that C++ is some sort of universally supreme language is preposterous. (Granted that I mostly like to program things where C++ is, if not ideal, then at least fairly suitable.) Every language has its pros and cons. However, listing pros and cons of a language requires you to have some sort of frame of reference.

That said, no language is perfect. Every language has its strong points and weak points - at least every language that makes it to the market; an objectively bad language won''t cut it. Java does have advantages over C++: It''s extremely portable, its reference model saves programmers from numerous horrid pointer mistakes, and so on and so forth. On the other hand, C++ has advantages over Java: Its compiled nature makes it potentially faster, it allows low level access to the system, et cetera.

Name any two major languages, and I guarantee you, neither will be objectively better on all points. I suggest you browse the web a bit (of course, if you''re into game programming, which is probably a reasonable assumption, given the forum and the phrasing of your question, you''re probably more interested in OOP and imperative languages than, say, functional or logic programming languages ...).

Most people around here will probably just tell you to use C++, which is not a suggestion without merit: In the game development area at least it seems to be the most widely used; it has a vast user base, there are countless resources and books covering it, and it certainly fulfills most requirements game programmers would have. Remember, however, that this does not in any way mean that it is objectively the best choice.
quote:
...and it certainly fulfills most requirements game programmers would have...


C++ CAN fulfill ANY requirements game programmers would have
(any requirements that an other language does), in C++ it''s very
easy to create a bunch of assembler instructions... So, nothing
is impossible with C++.

And about the commercial apps made with JAVA like I said, I''ve
never seen it, it doesn''t mean it doesn''t exist, it only means
that it isn''t everyday that we see one...

I''m not saing that JAVA isn''t a powerful programming language, it
is, I just think that JAVA is not so good as C++...

Kamikaze
Advertisement
OK, I''m just goign to try and clarify my earlier post. I''m not saying Java is better than C++. There are very few cases where I would consider Java over C++ as the right tool for the job. I was simply stating that C++ isn''t the best for everything. There are some languages better suited to certain tasks. And yes you can use inline assembly to do some stuff, but that code has to be re-writen when it is taken off of the platform it was writen for. If you write inline assembly for an x86 computer, it''s not going to work on say a Mac, or vise-versa.

In the context of game programming, C++ is the prefered choise of most, but it''s not the only choice.

And yes, Java can be used to write games, there not going to be fullscreen fps with awsome frame rates, but you can use openGL in Java, and write some pretty cool looking stuff. OF course it''s never going to be as fast as C++ for 3 simple reasons. 1) Garbage collection. 2) Array bounds checking, and 3) It is an interpreted lanugage run through a virtual machine. Even EXE''s made in java don''t run that fast. Hell someone even released a game for the playstation written in lisp. I can''t remember the name of the game, but it just goes to prove that games don''t have to be written in C/C++.

I personally don''t even like programming java all that much, I just hate when people blindly say that C++ is the best for EVERYTHING, cause there''s a time and place for everything, dare I say it? Yes, even Basic has it''s place in SOME situations.
quote: Original post by Kamikaze15
C++ CAN fulfill ANY requirements game programmers would have
(any requirements that an other language does), in C++ it''s very
easy to create a bunch of assembler instructions... So, nothing
is impossible with C++.

It''s true that C++ supports the use of inline assembly, which means that you can do anything your computer is capable of. In all fairness, however, I don''t think this qualifies as being C++ - you''re using assembly language; another language.

Even so, the fact that C++ can do just about anything you want doesn''t mean that it''s a convenient solution. You can do anything you want with assembly language (you''ll sacrifice portability, but that''s also true with C++, in a way), but that doesn''t mean that we want to make games entirely in assembly language.

I''m not saying that some other language (like Java) is better for game development; I, too, would choose C++. But great games have been written in C and in Pascal, and a large number of games (usually smaller ones) have been written in Java. Moreover, many games written primarily in C++ make use of very high level scripting languages for ease of use, and tools written in all sorts of languages; I''d imagine notably Delphi and Visual Basic (which are probably better choices than C++ in these situations).

quote:
I''m not saing that JAVA isn''t a powerful programming language, it
is, I just think that JAVA is not so good as C++...

... At what?

You can''t just take this out of context. In game development, for many purposes, C++ is arguably better because, being compiled, it''s potentially faster. Also, Java doesn''t support generics (yet), and the lack of pointers can get cumbersome. However, Java has the advantage of being portable, and the Java equivalent of a C++ program is likely to contain fewer lines of code.
quote: Original post by Modena_au
Hell someone even released a game for the playstation written in lisp.

... I''m all for diversity, but that''s scary.
quote: Original post by Miserable
...
However, Java has the advantage of being portable, and the Java equivalent of a C++ program is likely to contain fewer lines of code.


Exactly how likely, and why? I don''t buy it.

To be fair, java with library support automates certain tasks, but inflating on the other side, you have to write tons of wrappers, you need one line of code per value to support things like enums (plus your own implementation), there''s no feasable way to share common pieces of code, etc. BTW, consider also the STL when you consider the C++ implementation vs a java implementation (note that STL is part of the standard).

No, I''m not saying that the answer would be C++ is smaller... I just really doubt you could assess the above likelihood, especially for any project of any non-trivial size (and more especially, without naming the type of project, and/or even considering that we''re actually talking about making "serious" games, where hopefully it''s understood that "serious" means something an order of magnitude above tic-tac-toe).

Dislaimer: I''m only talking about lines of code.
Advertisement
C++ learning curve is stiff, but rewarding... I believe it has its place in versatility... er... I believe it has the most versatility... and have much hobbyists.

JAVA should be relatively easier than C++ (IMHO), without pointers one could saves a lot of troubles. Versatility is comparable to C++... you definitely need it most of the time for job recruitments.

VB definitely not suitable for most games prog. Solitaire or tetris like games should be fine though. Versatility is rather lacking. However I found it easiest to learn... suitable for ages of 5 and above.

[EDIT] .. and oh, remember that there's no 100% portability. C++ often can be portable as well when written without any specific API calls. Consider this:
  #include <iostream>int main() { std::cout << "Hello, C++" << std::endl; }   



[edited by - DerekSaw on December 11, 2002 1:41:23 AM]

[edited by - DerekSaw on December 11, 2002 1:41:51 AM]
"after many years of singularity, i'm still searching on the event horizon"
quote: Original post by Anonymous Poster
Exactly how likely, and why? I don''t buy it.

I''m sorry, that was just sloppy of me: I have read that the Java equivalent of a C++ program is likely to contain fewer lines of code. While I have no evidence to back this claim, I also have no reason to believe otherwise, so the possibility is probably worth considering. (The need for forward declaring in C++ springs to mind: You might be able to save yourself some typing and confusion if this were eliminated.)
quote: Original post by DerekSaw
.. and oh, remember that there''s no 100% portability. C++ often can be portable as well when written without any specific API calls. Consider this:
  #include <iostream>int main() { std::cout << "Hello, C++" << std::endl; }    


... And this is all very well and good, but for all its merits, it does require recompiling your source code.

This topic is closed to new replies.

Advertisement