Hello,

I was creating a game in java and a thought came to mind, would it be better to dump it all and start from scratch with C++. So my question is, with all the cons I've listed and all the other issues that you know, what am I better off doing?


Cons with staying with java
-slower
-probably won't be able to do some things that I want to do with it
-listening to game controls and keyboard is a little tricky and not guaranteed to work.

Cons with making the switch to C++
-I'll have to spend time learning a new language
-not portable
-I'm guessing there's no easy to use API with abstractions I can easily make use of.
-probably more work will be needed in contrast to java.

Recommended Answers

All 4 Replies

Java isn't nearly as slow as you think. While it does have a slower start time due to the initialization of the Java Runtime Environment, code optimizations are performed on-the-fly, and in most cases Java performs similarly to equivalent C code (or better). The biggest issue with Java is that it doesn't have nearly as many libraries available to game developers as C or C++. I've never really played around with this side of Java, but I'm sure for a simple 2D game there's no real good reason to suddenly switch to C++.

Thanks, do you know if there's a way to have java work with C or C++? Like you said Java doesn't have a great amount of support for game development and one particular issue I'm having is listening to game controllers (joystick, game pad, etc). So I thought I'd use another language as a way to listen to things like the mouse, keyboard, joystick and other controller.

>Thanks, do you know if there's a way to have java work with C or C++?
It's possible, but probably not worth it. While it's true that Java is a bit lacking when it comes to game development libraries, that doesn't mean they don't exist. For example, here's a highly portable Java input library for game pads, joystick, etc:
https://jinput.dev.java.net/

There's even Java bindings for SDL, if you're interested.

I guess I'll just stick to Java then.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.