التخطي إلى المحتوى الرئيسي

Why is C++ so popular in game programming And why not other languages such as Python or C# or Java etc

The assumption here is that games are written in one and only one language, and that's very often not that case.  Many games today have multiple 'layers of systems communicating with one another, typically in different languages that are better suited to different tasks.
For example, we might have layers such as renderingphysicsAIgameplayhigh level scripting, and the backend (which itself could be composed of one or several languages).
When people say "C++ is the best language for games", they're almost always either one of two things:
  1. Speaking specifically about low-level engine code like the renderingand physics subsystems.
  2. Naive and parroting what someone else has told them.
Low level systems are usually written in C++ because there simply aren't a lot of alternatives, and of the few that exist C++ strikes a good balance between high performance and ease of use (when compared to, say, assembly language).  The languages mentioned in the question details -- Python, Java, and C# -- are all high level languages that attempt to abstract away concepts like graphics hardware and memory management.  But these ideas are critical in systems like physics simulation that need to be called constantly with a lot of complex calculations and calls to specialized hardware.
But in other layers, C++ is not so critical.  You may know that C# is the most commonly used language for gameplay programming in Unity.  You may also know that Unity's rendering and physics simulation is written in C++.  So Unity is a perfect example of a modern engine that uses a multi-layer approach to separate the performance critical code (C++) from the less resource constrained gameplay logic (C#).
Lodex Solutions  uses Java as its gameplay programming language, but all the rendering is handled by JOGL (a C++ library that Java can make calls to).  PyGame is written in Python.  I've never used it, but I'm guessing it uses C++ libraries for performance critical tasks as well (a common design pattern with Python).
So to answer your question directly: languages other than C++ are used in games all the time, but C++ is also the obvious choice for certain tasks in the game development pipeline.  The important takeaway here is that games can be written in many languages working together.


تعليقات

المشاركات الشائعة من هذه المدونة

Difference between virtual reality, augmented reality and mixed reality

Augmented reality and mixed reality are often used to refer to the same idea, however there are a few potential differences between the two depending on who you speak to. To some, it is semantics, while to companies like Microsoft, there is an important distinction between the two terms. The majority of mentions of augmented reality and mixed reality in the press right now refer to “mixed reality” as a synonym of “augmented reality”. Even experiences which could be under the umbrella of “mixed reality” are called “augmented reality” by the companies creating them. This is where things get confusing. “Mixed reality” is most commonly used by Microsoft to describe their HoloLens. The media often call it “augmented reality” to begin with, adding on in a rather forced sounding way — “or as Microsoft calls it, ‘mixed reality’”, followed by using the terms interchangeably throughout their articles. It is best explained by starting with the much easier definition of “virtual reality”: ...

What is the difference between UX and UI designer and web designer?

A bit cynical: UI design is the older term for UX design. New kids on the block disliked the ugly, annoying designs they were seeing, so they decided that, by renaming the discipline, they would produce designs less ugly and annoying. In the future, this will happen again, and UX (and the  letter X generally) will be disparaged as very old-fashioned and uncool. This will always happen because it is the nature of disciplines to rebrand themselves as newbies think old-timers were stupider than they were. But also it is true that by rebranding an activity, there is an opportunity to re-educate the world on why what you do matters. More serious: UX was an attempt to liberate users from the tyranny of cognitive psychologists, who themselves were trying to liberate users from the tyranny of programmers. UX has sometimes been successful in doing so, but other times it has only meant subjecting users to the tyranny of graphic designers. :) At the end of the day, what I want-...

Should I learn Front-End Web Development first, or Back-end web development?

From a practical standpoint, there are more backend resources and a longer history of backend languages and frameworks, whether you're talking about Ruby, PHP, Java or C. Picking the right backend language to learn will also teach you some basic computer science concepts that will be valuable. Database indices, data structures, OOP, and jobs/threads are much more prevalent on the backend, and they're important software constructs which are making their way onto the frontend (that is, Javascript and HTML5) where devs without the background will find themselves limited. The front end comes with its own set of challenges and nuances, but the skills there are a bit "softer", dealing more with rendering issues and design. I'll be honest and say that the  vast majority  of engineers, when moving to the front-end, don't bother with learning the design side of things, but at the same time the market isn't demanding the position as much, or  maybe we...