So you say C++ sucks? What else can I use?

Started by
28 comments, last by guywithknife 13 years, 11 months ago
Quote:Original post by Telastyn
C++ sucks. That said, it's probably your best option if cross-platformness is a hard and fast requirement. I would question that requirement though. It forces some of your design decisions and limits your ability to get the game done. For what? Maybe 5% more users in the ideal scenario?

QFT!

Of course, everyone here (myself included of course) is biased so you're only really true answer will come from evaluating the possibilities and making you're own decision. Personally, I'll never touch C++ again. It's just not worth the frustration. I'm not doing cutting edge games and I only care about Windows PC, 360, and soon Windows Phone 7 so C# and XNA Game Studio are perfect.

Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Advertisement
Quote:
Nowadays, it's pretty common to see people bashing C++ of various reasons (too complex, etc.). Most of these arguments are totally correct - there are a lot of other programming languages that are more simple, less error prone, and so on.

I think you're taking most of these arguments -- at least, most of the valid arguments -- out of context.

I think you are overestimating the impact of the "performance advantage" of C++. It is a language allows for fast code to be obtained decently easily because of its lack of basically any high-level features and it's bend towards paying only for what you use. To write truly stellar code with it, however -- just like with any other language -- you have to know it very well.

C# plus some kind of OpenGL wrapper may be an option (XNA is eliminated by your desire to deploy to Macs and Linux, of course). As are all the other languages mentioned in this thread -- Java, Python, et cetera.

The correct answer is thus to use the one you are most familiar with it -- whether that be C++ or something else -- because that's the one you will be most productive with and the one you will be able to write the most efficient code with.
Im just going to say that before you choose your language... DESIGN the program first and do an honest assesment of your abilities. Then you will know what you actually will need.

Having a learning experiance can in fact be a legitimate goal of the program. If you want to be a generalist then you need to aquire experiance in many languages including the dreaded C++. If you prefer to become a specialist then select your language and make all your projects fit it.

ANSI C is an almost universal language but is also an easily abused one. It requires a lot of care and discipline by the programmer to write quality code. Much of what other languages offer is in fact availible to ANSI C as a matter of program design.


I would confirm BrianLarsen's statement.
Quote:ANSI C is an almost universal language but is also an easily abused one. It requires a lot of care and discipline ...

C++ is neither good nor bad. It gives the programmer full control
and some shortcuts.
Thats the dangerous thing about it. You get seduced to use these
shortcuts rather than doing it the right way which will make your
code unreadable.
Python forces you into the "right" direction and ofcourse takes a
lot of work away from the programmer to the VM but my opinion is
that this does suppress the own style of a programmer.
Java is a choice too and a good one for platform-independece but it
has its cons like every VM driven language.
Finally it is mainly a choice of what language is your favourite and
how well you structure your code.
My own interpretation of the answers, so far:
-C++ doesn't suck, use it.
-Python is a good way.
-C# has several interesting engines/frameworks.
-Write most code in Python, with some parts in in C++.
-Cross-platform is stupid.
-Any language, blah blah.
-Java is a good way.
-UDK. (?!)
-Java is a good way - again.
-C++ sucks. Microsoft platforms is the only good way. Yadda yadda.
-C++ doesn't that much of a "performance advantage". Any language, depending on what you are most familiar with.
-Design first. Choose language depending on what you want to learn.
-All languages have their advantages & disadvantages. Pick your favourite.

First of all, thanks everyone for the replies. Secondly - you sure don't agree with each other.

One thing that I find interesting is that some people avoid C++ because it is unproductive. "Write less code and make fewer errors, by choosing this better language", they say, and point at some other new cool language like Python. Sure, I like Python. I really do. And I like C# too. But tell me - is it really that more productive to write something with OpenGL in C#, than it is to use a good mature 3d engine with C++ (Irrlicht, Ogre) ?

The thing is, I havn't come across that many _mature_ game-related libraries for those languages. I will, however, keep looking.

As it seems right now, I will probably stick to C++, using Python for some scripting. I might give C# a chance, if I find a 3d (or game) engine that suits me.

And by the way, I'm not a "n00b" trying to make a new cool mmorpg. Sorry to disappoint you. Just trying to get back to my game development hobby.


Quote:Original post by SoldierX
One thing that I find interesting is that some people avoid C++ because it is unproductive. "Write less code and make fewer errors, by choosing this better language", they say, and point at some other new cool language like Python. Sure, I like Python. I really do. And I like C# too. But tell me - is it really that more productive to write something with OpenGL in C#, than it is to use a good mature 3d engine with C++ (Irrlicht, Ogre) ?
No. It is most productive to use C# or Python or Java or whatever with an engine. For instance, if you're set on Ogre, you could use MOGRE with C# or Python-Ogre with Python or Ogre4j with Java. Or you could use an engine that's designed to work with your language of choice, rather than being bound to it, such as XNA with C# or Panda3D with Python or jMonkeyEngine with Java.
Quote:The thing is, I havn't come across that many _mature_ game-related libraries for those languages.
Maturity is always an issue when looking for open source libraries. Certainly some of the libraries I mentioned up there are crud. 90% of libraries for these languages are crud, but that's because 90% of libraries are crud. Standard crud-avoidance strategies apply.
Use D.
SoldierX, I think you came to a good conclision.

I kind of miss some level of experience attached to what people write in forums. If someone played around with c++ and decides its not good how strong can such an argument be?

I have been developing games in in C for over 20 years and C++ over 15 years. I am almost programming daily. And frankly can find no argument against the language.

When I first checked out XNA I stumbled upon C#. Later with iPhone Development I saw this funny looking syntax called Objectiv-C. Now I am glad I wrote a nice C++ wrapper for iPhone. My code base compiles on every platform I have been so far. I am sure if you were to stick to anything besides C/C++ this would not be the case.

As for "scripting" languages this is something else. As I don't see them suitable for engine development, but more gamelogic and so forth.


Looking back I am happy with the way I went. (especially since back then people said Pascal would rule the world. lol)
However I can actually not really judge if C/C++ is the right way to go if you start all from scratch. Time is moving.
Food for thought.
Quote:Original post by Antheus
Food for thought.


What I would take away from that is that reusing and updating existing code as needed is good. Reusing engines is good.

What I wouldn't take away from that, nor the comments section, are the comments on the 'games industry' as a whole. He, and his commenters, appear to have missed that MANY games do reuse the same engine, just an updated version of it.

My favorite comment cited Valve as a good example of 'engine reuse' which is true... it's just that TF2, L4D and Portal all used an engine which had been updated from the original Half-Life.

So; once again, code and engine reuse good.

And while this guy might be doing well his view that he is the only one doing it places his head firmly up his bottom region I feel [smile]

This topic is closed to new replies.

Advertisement