Job Recruitment Website - Zhaopincom - Why Java is not suitable for game development?

Why Java is not suitable for game development?

As a game server developer for many years, I will answer this question. As long as you look at the recruitment website carefully, you will find that there are very few games that recruit java (I hope I don't say too much, I don't say too little, not that there is no). So why are the overlords in other fields not even qualified to drink a soup from the game industry? In fact, there are two main reasons, and they are all related to the efficiency that programmers are most concerned about. One is development efficiency, and the other is operation efficiency. Unfortunately, as a java that can't get up and down, you can't have both.

The first is development efficiency. A few years ago, mobile games were popular, with many game companies and high product similarity. So how to develop the game and put it into operation as quickly as possible, try and error in rapid iteration, and reduce the development cycle is to reduce the development cost. In this environment, many scripting languages java become the first choice, such as nodejs, php and even lua and python (another point here, although lua itself is very simple, actually lua's use cost in the game field is very high, at least the highest among the four scripting languages, because it is only a glue language and depends on c/c++, and as a library around the game, you need to build or find wheels yourself, but for the engine part, Nodejs can be written in js (the popularity of html5 makes this situation more and more). Moreover, php is easy to use and simple to develop, and I like some free video tutorials.

If you ask me is java suitable for developing games? My answer is absolutely appropriate. Java has high development efficiency and average running efficiency. Just write it in C or cxx where it needs to run efficiently. Most of the games on the market are not developed in a single programming language, so there is no need to entangle with the language for too long.

Many people say that operating efficiency is also very important, but in fact, you can't feel the difference in general logic. Use java or c# for general logic, or such an efficient scripting language, and a language with high debugging efficiency will make you more comfortable to develop. Especially scripting languages.

C and cxx are only used where efficiency is particularly needed.

Ha _, this is the sub-period! Java is inefficient in developing games, but it is ok to develop some small games. Teacher Yuan Biao said that java is object-oriented and all methods are encapsulated in classes. If you want to call a method, you have to have an instance class, and the game is mainly about logic.

Objects, like machines, have many functions, but my game logic only needs one function of each machine, but if it is to be used, it must be made by the whole machine. This is the defect of object-oriented, right?

C is process-oriented, which can design process logic more flexibly, save a lot of unnecessary things and greatly improve the performance.

The advantage of java is to make use of existing class packages to achieve the effect of reuse and greatly improve the development efficiency.

Of course, java can also design classes only for logic, but that's not java's strength and it doesn't make much sense.