Programming games as a hobby, should I use Java or C ++

I am currently learning Java from the Art and Science of Java book and following the standardized Stanford Standardization Methods course.

I would like to do game programming, but only as a hobby.

I was wondering if Java would be a good choice or C ++ - a defact in game programming.

+4
source share
22 answers

Since you are learning Java, I would recommend you stick with it.

If you are just developing games for fun, it doesn't matter which language you use.

+20
source

It depends on whether you want to know more about C ++? Do you need to know? There are still OpenGL Java libraries that are available, and the concepts will be essentially the same no matter what language you work in. If it’s just a hobby, then I don’t see anything wrong with working in Java. However, in terms of speed, lower-level languages ​​are preferred.

+7
source

Or everything will be fine. For the hobby, they both have pretty good low-level support for graphics, etc., and both also have good higher-level libraries for games (jMonkey engine, SDL, SFML, Ogre and many others).

You can also consider other languages. Python has SDL bindings called PyGame. C # has an XNA infrastructure that has several books published for it to help learn about the structure. SFML has bindings for C ++, C, D, Ruby, and I think Python. All of them are then suitable for creating games. Just select a language and release.

+3
source

If you ask me, neither Java nor C ++ will be interesting languages. Both of them have a number of advantages, but if you do it for fun and do not have deadlines, I would look for a language that would be more fun. Like Python, or something like that.

+3
source

If you want to create games, you really need a gaming platform, as well as a language, otherwise you will spend all your time solving basic problems, for example, how to draw a sprite on the screen, and not concentrate on creating a fun game.

Great choice for developing hobby games:

  • Microft XNA platform with C # language
  • Adobe Flash with ActionScript
  • Sun JavaFX platform with JavaFX script language
  • Unity3D with C # language
  • Ogre with C ++
+3
source

You can write games using both languages, but I think you really should try C ++. There are much higher-level libraries and game engines in C ++ than Java, so it would be easier to find one that suits your needs. Not to mention that many old games were open, and you can freely download them and study the code. You can guess what language they use;)

You will also find many more tutorials and books that teach game programming using C / C ++.

No matter what you choose at the end, enjoy writing your games :)

+2
source

If you go with Java, I recommend Computer Graphics for Java programmers, Leen Ammeraal .

If you were developing commercial games, you would use libraries rather than implement these algorithms yourself, but it’s easier when you know the basics that you can learn from a book like this.

I once wrote a software rendering for a DOOM clone in Java, and this reference book has helped a lot.

+2
source

C ++ is a defacto language not only for game development, but also for everything else, including the browser that you use with the OS it runs on.

So, if you are considering the seriousness of programming, C / C ++ should be at the top of your list.

As for speed, C ++ is generally faster than Java. Why at all? Well, the truth is that C ++ is faster than Java, faster than almost everything else in fact, but sometimes C ++ code can be poorly written, and Java can prevent beginners from making some mistakes, resulting in many claims about that Java, like C ++, there are even claims that Python / Psyco are as fast as C ++ and faster than Java.

Keep in mind that no program written for the framework (Java, .NET, VB, etc.) will ever run faster than a program running at a lower level (directly on the OS or even on the hardware), e.g. in C / C ++, ASM, Pascal, etc.

Take a look at this:

Poorly written C ++ half the speed of Java, correctly written much faster

At the end of the day, you should go with a language that will be comfortable with you, remember that python is ready to work, commercial, stable, great for beginners, awesome for use in Web 2.0 projects, not to mention that too very funny.

+2
source

Java - I would advise you to stick with one thing and get good. Ideas remain unchanged, and when you learn more about one language, you will begin to learn about the disadvantages and advantages that are now widespread in many methodologies and programming languages.

+2
source

Even if you never intend to enter the professional development of games, there is one big advantage for C ++, which means that you have much more resources available. There are more books, more tutorials on the Internet, more open source examples to look at, and more people who can answer your questions on sites like gamedev.net.

+1
source

I developed a couple of small games in both C ++ and Java, and I would choose C ++ every time. This gives you a low level of control that you simply do not get with java. But game development is a completely different beast. So if you want to explore the development of games, start with something that you comofrtable with

+1
source

If you think you ever want to work in the industry, you should learn C ++. C ++ is used to create almost all commercial games that run on PC / xbox / ps 3. I assume that wii is the same, but I don’t know 100%, I never worked on wii.

In the game studio I worked for (before its close), C ++ was used for the game (small details used C and assembler) and started using C # for tools.

If this is only a hobby ever, it really doesn't matter which language you use.

+1
source

I would suggest trying Haaf Game Engine for C. This is a very simple 2D engine with good documentation, tutorials and examples, runs on Windows 98 and higher, and it is absolutely FREE even for commercial use!

If you are completely new to game development, this is right for you IMHO.

+1
source

Just a hobby? If you use Java, then Java. But first, what are you programming, 2-D or 3-D games? Java does both, and it is my game programming language, but I only do two-dimensional programs. C ++ is the defacto standard for serious gaming programming, especially commercial games.

Java has a great IDE called Eclipse, which I should do Java on my own ... Eclipse rock! And it's free.

C # - no. The path is too dependent on Microsoft.

Btw, Java will work as an applet and as an application, if you plan it well, the application will work on all three platforms ...

So think about it. Low investment, high-quality tools, cross-platform. If you decide to get into C ++, then this is also good. At least you will wash your fingers on your nose for free ...; -)

+1
source

The language defines the target platform and accessibility. Both Java and C ++ have advantages and disadvantages. You will use the same architectures and algorithms on any platform. If you know how to write a game in C ++, you need to write a little game in java (2 weeks for me http://madeinsoviets.net/ ). Start learning programming with C ++ and some lightweight game engine (Ogre3D, irrlight) - much more information and tutorials.

+1
source

An old topic, but since people are still reading this, I want to add my 2c with its unique to this post.

Stick with java is a great way to make C ++ games if you are going to do it as a hobby for yourself for these two reasons.

  • 10 times less coding for the same results (although it works about 5x slower)
  • Android games, even mediocre ones, will sell (every dollar) to the market. if you sell at least one of them, you will feel great pride! (also java does not slow down work on C ++ on android, since its JVM is unique and works against an API directly accessing hardware, which is fantastic!)
+1
source

If you just do it as a hobby, it probably doesn't matter. Just use what you like best, so you can get into the turn of game programming. As soon as you get better, it may seem to you what the “best” language is.

0
source

I would definitely suggest C ++ if your intention is general game programming. Of course, if you want to develop for a mobile platform such as Nokia and Ericsson, then Java might be a good idea.

But if this is for ordinary board games, then, of course, C ++. If you want to deploy games over a network, then flash might also be a good idea.

0
source

If you plan to enter the industry (or maybe a day start selling your game yourself), you need to learn C ++.

Java or C # is a good choice to get to the point of creation of the game without worrying about the machine (memory and speed). This is recommended for beginners, but I personally would start directly with C ++.

0
source

If you are learning game programming, then C ++ is the way to go. Of course, Java will be good for certain games, but C ++ is much faster.

I precoded in Java and then started coding in C ++. The time spent in C ++ helped me understand some things that were greatly simplified in Java.

Depending on how much programming experience you have, I would suggest learning the basics of Java, and then moving on to C ++.

0
source

If you are starting with Java, I recommend this book Physics for Game Programmers

0
source

In general, C ++ for real games.

Java has always been slow for me, regardless of the platform or program that I use.

C # is better than Java, but not as good as C ++.

Yes, there are exceptions, but the fact that they are so noticeable more likely proves that C ++ is just the way to go if you really don't know what you are doing.

-1
source

Source: https://habr.com/ru/post/1285999/


All Articles