Is making game with c possible?

Started by
16 comments, last by Ravyne 7 years, 11 months ago

oh thanks very much! I guess I should go on writing the game instead of sticking to such questions...

Advertisement

QFE. C vs C++ is a bloodied and savage battlefield populated by extremely powerful idiots. Thar be dragons.

It's like our very own Blood War: https://en.wikipedia.org/wiki/Blood_War

why we always use c++?

We do?

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

why we always use c++?

We do?

Shhhh you're not part of this clubhouse. Go back to your coffee beans or whatever it is :wink:

why we always use c++?

We don't. I personally use C++, C#, JS, Ruby, Java( Joke, who the hell uses this?), some python, and some more.

The variety is huge when talking abouty tools today. You can use whatever you feel comfortable with.

You can even experiment with new tools and languages. (Recommended)

what is the advantanges of c++ over c in game development?

The ++.

It has far more features which in generally make you more productive.

You don't need to reimplement code that has been reimplemented over million times.

Although low level api is still in C, you could take advantage over the high level api that is in the market to make a game faster.

Don't be a hipster, there is a reason C++ is an industrial standard, I advise you to read on your own and learn what C++ is capable of.

and does making game with c makes sense at all?

Yes. Mainly with low level api such as OpenGL.

C was always there, it is not considered hard but it is not easy either.

You need to stick both legs in the mud and shove a spoon inside your mouth, but it is possible.

The modern pseudo-argument in favor of C is that its "more transparent" -- namespaces, and classes, and templates, and operator overloading, and virtual member functions, and overload resolution taking all of those into account, and lambdas, and exceptions, and rules of 5 and 3 and 1, and on-and-on are all compiler voodoo that some believe is too opaque to be trusted -- or, at the very least, that it short-circuits critical thinking regarding platform-level details, and sometimes that this allows lesser-skilled programmers ("undesirables") to sneak in and wreak havoc in places they are not welcome. This is the basic position that Linus Torvalds takes with Linux kernel development (unapologetically, as is his custom) -- though, there are good reasons for not wanting a mix of C and C++ in the kernel, and C is already entrenched for historical reasons.

But I don't consider that a good reason, for or against, myself. Many patterns that C++ makes easy are useful (e.g. classes, virtual member functions) in C, and can be replicated to a reasonable degree with some work -- for example, a virtual member function in C++ is basically a function pointer with a convenient syntax for declaring, defining, and calling them. C code that does this sort of thing looks different, but you can find examples of it in the Linux kernel, in Quake, and in Halo's engine.

C++ is generally more convenient and productive than C, IMHO, but there is some truth to the argument that the compiler does things behind your back, and its true that this can in some cases cause trouble. But its not terribly difficult to learn where most of the dragons are, and to guide yourself to a comfortable subset of C++ and way of speaking it that avoids them.

throw table_exception("(? ???)? ? ???");

There is no need to use c++ for making games. You can make games in plain C as well - just using structs and unions.

But there are a few features from the c++ compiler which makes life much easier - operator overloading and zero struct initialization. Thats it.

There is no need to use c++ for making games. You can make games in plain C as well - just using structs and unions.

But there are a few features from the c++ compiler which makes life much easier - operator overloading and zero struct initialization. Thats it.

"That's it -- operator overloading and struct initialization are the only things that make life easier in C++"? Or, "that's it -- you can mostly do everything in C that you can do in C++, but C++ is often a more convenient language"?

The former falls far short, the latter is a reasonable approximation. I would encourage today that there's no good reason to avoid C++ in favor of C, unless you are not in control of all the reasons you have to deal with -- you have no choice if C++ is unavailable or impractical for the obscure micro-controller you're programming. You have no choice if your boss says "We speak C here" or if you're hacking on the Linux Kernel. You have no choice if this is CS 110: Introduction to C. But if you're in control of the reasons and the thinking surrounding them, then there's precious-little reason to choose C other than simple, personal preference.

throw table_exception("(? ???)? ? ???");

This topic is closed to new replies.

Advertisement