C vs. Java for game programming [closed] - java

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I understand that C++ is generally considered better than Java for games (at least larger-scale games). Why is this?
What is keeping Java from being competitive in this field? Which reasons against using Java for game programming have the most basis, and which ones are myths?
EDIT: Am a bit unfamiliar with C/C++, and did not think to differentiate between the two at line 1 >.<

The reason Java (and C#/.NET) is not a viable option for AAA titles at this point is the established game engines and their toolchains are written in C++. Game development is all about getting a title on the market in the shortest amount of time, and budgets don't allow for piddling in things like a new language/engine when several are already available, work well, and have an extensive set of editors and tools backing them.
Moving to Java (or C#) would also require a new performance-driven JVM (or CLI) across the big-3 (PC, X360, PS3) or big-5 (add Wii, iPhone). It's technically doable, but not financially viable.
Edit: Anyone with low-level knowledge of both virtual machines and the current state of game engines can tell you that a JVM or CLI could unquestionably be implemented with a new game engine to beat the performance of current C++ engines. The preventing factor is time and money, nothing more and nothing less.

High performance and the inertia of C and C++ traditionally being used for games.
Choosing based on performance isn't that big a priority unless you are making a 3D extravaganza.

Because:
Java is not compiled to native code, meaning that there is a performance hit the first time the code is run.
Java does not give you a predictable memory model (console games need this)
Java does not give you deterministic object finalization.
Java is not as close to the hardware as C is, an essential for a lot of professional 3D game programming.
Console programmers likely don't have a JVM that runs on the PS3, X-Box, etc.
Runtime performance penalties.
You will never be able to squeeze as much performance out of a Java app as you can with a C++ app.
There are probably more reasons, like the fact that they are using pre-existing code that was written in C or C++.
EDIT: As an aside, I don't think that many modern games are written in C. OOP lends itself to game development, and C++ is the de facto language of choice.
Also, I won't add it to my list, but as others have mentioned there is a lot of pre-existing code that works very well that is used in the game industry. It would not be practical to rewrite all/most of your tools just to switch to a new language especially when that switch could cause you a lot of headaches.

I would say, despite the other answers pointing to a lack in speed caused mainly by the JVM, that the real reason people don't code games in Java is the lack of support for environments such as DirectX and OpenGL (which actually remove the need for your code to be close to he hardware as it was suggested by some answers). They are the base frameworks that people generally use to code games, especially nowadays with 3D games being everywhere - and lack of support for them is the reason why Java is not considered as a language for game development.
To emphasize my point, I would suggest you take a look at Microsoft's XNA which is currently optimized for coding in C# via the .NET framework (which like Java is Just-In-Time-Compiled and doesn't run natively per se). The XNA framework interfaces with DirectX which talks to the hardware and so it is very fast.
EDIT
#Ed Swangren's comment made me realize yet another distinction between .NET vs Java when considered for game development. I think another strong point to .NET is that if you do need to be able to squeeze out that last bit of performance and do some pointer math or implement a sophisticated high-performance algorithm it's a lot easier thanks to the unsafe mode. Of course you can even go beyond that and write native libraries to be used by your C# code which is made pretty simple thanks to P/Invoke.

Leaving C(++) aside for the moment... I am inclined to say much of the reason is that Java lacks anything like XNA. What advantages does Java actually have over a language such as C++ when it comes to game development? You have to consider that several of it's typical advantages disappear for the specific area of game development, while C++ gains several.
XNA is what made C# a highly popular language for amateur game development, and contrary to common belief, a quite viable option for commercial development too. C#/.NET being a parallel to Java in so many ways (and arguably a better framework nowadays), when people now have the option for game development with a higher-level language, C# would seem like the much more appealing one, unless cross-platform support is essential (then again, we have Mono and OpenGL for .NET).
C (or rather, C++) has long been the language of game development due to their low-level nature (thus performance benefits) and the host of graphics frameworks (DirectX, OpenGL) and engines that primarily target them. It's usage is embedded in game development and been used virtually since the inception of the industry - and won't disappear any time soon, I suspect.

Java doesn't have as controllable performance
Its highly reversable so harder to protect
Many Games employ scripting languages like lua or python to get "higher" level programming
the API of most systems is C oriented.
Java can be used for back end server systems that games connect to
Flash games seems to of taken the niche Java games could have had.

Java can be optimized to be very fast, as is evident by an interview I had recently with a high-frequency trading company, where they do use Java, as well as C++.
Java has OpenGL bindings, as others have pointed out, so getting to the hardware isn't such a problem, esp since not all games need that, some commercial games have been written for Java3D.
You can use Scala or F# if you want some more performance for multi-threaded or numerically intensive operations, and just tie those in with the GUI.
But, as others have mentioned, the tools that are used tend to be written for C++, and some companies feel more comfortable doing some optimizations in assembly, but, given the fact that the new cpus are very complicated, with multicores, it is unlikely you will get any performance increase over the optimizations from the compilers, but, as long as companies feel these optimizations are still needed, they will stay with C++.
If some developers wanted to write commercial-grade tools for Java or .NET, there could be a market opportunity there, but it will be a great deal of work to make it as good as what is already out there.

I think C or C++ is a better language for building many types of games because it is closer to the hardware and likely to be the first language implemented on any new hardware. Not only that the libraries for accessing many of the advanced features of today's hardware are likely to be implemented in C.
Your typically general purpose higher level language has no easy way to access features of the hardware unless it uses some type of binding layer to call the libraries which are written in C.
For instance how do you write code to access a GPU, or write a custom Shader, or write code that run well on a Cell chip, or run on an Iphone, or on a Blackberry in a high level language. Even when these things are supported, they come out well after other people are able to write games in C that use these features in games.
One compromise you can make is to use a higher level language like Java for most things and C where its needed. You will limit the types of platforms you support though.
Java might also be good for client/server games where the server is written in Java.

It's very hard to write a program that runs in constant memory without garbage collection in Java.

If you want to read statements from game studios who are happy to use java for serious game development then search on twitter for #javaforgames
https://twitter.com/search?q=javaforgames
By studying the Java developers tweets conclude that Java is good for game development if you use it in combination with a high level game engine API such as libgdx and jmonkeyengine that both ease development effort and makes the game tuned to take advantage of the OpenGL/ES hardware acceleration provided by modern GPU hardware.
Java do allow cross-platform goals using said engines on mobile, console and desktop.
Some game developers prefer java for the design phase of the game to engineer in-house tooling.
Java game studios and developers who seek the best performance can archive it by tightly controlling OpenGL by using JOGL or LWJGL directly. Also performance and flexibility archive this by writing their own engine, if time and money allows it.

I wouldn't say that it is always true that C is better than Java for game programming.
For example, if you want to write a game client which can be hosted in a web page, Java could be better.
When writing games which produce amazing 3-D graphics (e.g., Halo on the X-box), usually there is barely enough computing speed to generate all the pixels for each frame. In this kind of game, C would be preferable to Java because it allows the programmer to write faster programs -- at a large expense in terms of difficulty in extracting that speed.

I think it's mostly because c lets developers squeeze every last little bit of performance out of hardware, whereas Java doesn't, it's not low level enough for things like high end 3d video renderers. Basically c lets you squeeze out a couple more frames per second in your next gen shooter.

Inertia mainly... Although it's a bit old now, you can look at Jake2 (which is a pure Java port of Quake 2 with jogl as the openGL lib).
It can perform up to 85% as fast as the C++ original, which means it's fine for most games; especially modern ones which are more social and game play based rather than the limited "hard core" games.
I'd also suggest that most of the answers you get here are coming from a gaming geek/"I want the coolest hardware and games". For [these] hard core 3D games and gamers, that final 15% is hugely important, as that's what separates the $150 graphics card from the $500 one they just bought.
As John Carmack is reported to have said (something along the lines of): "If I were to enter games programming now, I'd program for the iPhone". e.g. it's not nearly as much fun to make the fastest game with the best 3d engine as it is to make the best game.

The console game market is about 10X larger (financially) than the PC game market. For current generation consoles, all the major programming is in C or C++ with some little bits of intrinsics or assembler. If you want to be a professional Game Programmer and work at any major game company, then learn C and C++.
More to the point, all the commercial cross platform engines that are that starting points for many commercial games are in C or C++ right now as well.
You may be able to work on small games in java and flash or even casual Windows games in C#. You can even code C# for XNA games but if you want to make REAL (pressed on DVD) XBOX 360 games you need to learn C++.
Speaking as a game developer at WBGames Chicago. We would not hire a programmer who didn't have strong C++ skills. The same is true at every other game studio that I know of.

The short answer is because almost no gaming platforms support Java, or if they do there is a much better alternative.
On the game consoles, seasoned game developers are using C because that's what they've been doing for 20 years. There's no compelling reason for Java games to exist there.
On the desktop, there are a few Java games, but they can't compete with the market leaders such as World of Warcraft.
On the web, Applets are long dead, and if you're going to make a casual game it's going to be in Flash.
In the mobile space, JME has had it's time in the sun but it's on its way to obsolescence in the face of far superior platforms such as the iPhone.
The perfect world scenario for Java to be a heavy hitter in the gaming world would be for Sun/Oracle to deliver a gaming platform like the Wii or the iPhone - a must-have device that everybody owns. Then, there is a good reason for developers to invest time into experimenting with new technology. But given Sun and Oracle's apparent lack of interest in the consumer market, the chances of them making a gaming rig are slim to none.

It's not a technical issue but purely a "client optics" issue for this.
Good Java code can run just as fast as good C++ code. It can access OpenGL just as fast as native C++ via projects like LWJGL and JMonkeyEngine.
The real reason is that Sun never put any effort into highlighting Java for games and they've never made any deployment particularly easy for Java games. It's a LOT of work and effort of the developer / team to create a seamless / smooth installation (and launch?) experience for the player.
Customers just don't "trust" Java games and bail during the install process when they see the logo.

Although old, no one here seems to point out
All the games and apps on Android are programmed in Java
Because not only is Android written in Java, so are most all of its apps/games/etc...

I will answer in a very different way.
If Java can nevre write a device driver like C, how can you Imagine that it would be faster than the language that the driver is already written in ?

Related

C++ vs Java in Android

I'm interesting in start a game development. I currently did some openGL in C++, but now I'm looking for the options that offers Android, and I have found people who developes his games using Native code (C++) and others that use Java...
So I don't really know which is the main difference. I read that many people has experience using C++ and prefers this one to don't have to learn new things using java... but I don't think this is the main reason.
What are the main differences developing a game using C++ or Java? Perfomance? Scalability? Posibilities?
Also, do you recommend to start the game development using OpenGL?
I would suggest using whichever language you are more comfortable with. A game is never a small project, and since you are new to the process (judging by this question) you will probably not be concerned with any performance differences or anything like that.
To answer your questions:
Performance
see C++ vs Java Performance, Android: Java, C or C++?, etc.
Possibilities
There is nothing inherit that C++ can do and Java can't, or vice versa when it comes to your goal.
Scalability
Not sure what you are asking with this one.
C++ can perform better than Java (don't believe the naysayers, do your own benchmarks), but there is more support for Java on Android. In the end it depends on how intensive your app is going to be and how much battery it is going to drain. If it is extremely intensive, go with C++ because you can do more with less. If it doesn't matter, then go with Java.
at the end it doesn't matter sense if you use c++ you will need to learn all those frameworks used for android development, if you use java you will learn java and openGL is the same in all languages so just go with c++ if you are a c++ developer
Also, do you recommend to start the game development using OpenGL?
you should not start with OpenGL not that you can't but I would sagest something like SFML witch will teach you a lot about graphics programming then you can move to OpenGL

GameDevelopment: (Java & OpenGL) or (C++ & OpenGL & SDL)? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Since Java supports OpenGL, what is the best option for developing a game?
Java + OpenGL
C++ + SDL + OpenGL
I always avoided Java (in game development, of course) because of it's speed. But, I discovered that Java supports OpenGL. So, I think speed can't be the problem anymore. What should you choose? Are there remarks?
Java would be a lot easier for me, because of my experiences in Java and the garbage collector.
In my opinion, if you have an idea for a game in your head it doesn't matter what you write it with (at first), C/C++, Java, pen & paper... Pick the language you're more comfortable with, prototype and test your game idea, once you have a rough sketch and know what you need to do, throw the prototype out, design the gameplay & architecture and then start coding the actual thing. Don't optimize until after you've got most or all of the functionality working (in general, there's always minor bugs to hunt) and you actually see where the bottlenecks are.
I've seen it happen over and over again, game programmers are among the worst premature optimizers ever, trying to squeeze out a few cycles from something trivial, while missing the biggest bottlenecks and then optimize some more (in the wrong place). I've also found myself guilty of this many times. I'd say don't pick C++ (or Java for that matter) because of the speed, you can get very good performance out from both, if done "right". If need be, you can always switch to another language, if the language itself is really the bottleneck or really preventing you from doing something. Java isn't automatically slow and C++ isn't automatically fast, you can go (very) wrong with both. I used to root for C and C++ in everything, but after having worked with Java for quite a while, I really don't miss all the hassle that much.
There are lots of (already optimized and fairly easy to use) game engines available for both languages, so there's no need to roll your own... unless you really want to. In my experience, most hobbyist "game programmers" tend to be more interested in the technical side of things than in the actual game (myself included) ;) Once all the technical hurdles are done and you get that nice model/bunch of sprites/particle effects running with some shader-effects, the enthusiasm seems to fade away... But don't let me discourage you, game programming is very fun, even if you never actually finish anything (I wouldn't call any of my own projects finished).
I haven't coded any games for a while, but for C++ 2D SDL is a good candidate, other option could be SFML, or if you want a lower level touch with OpenGL, you could try going with GLFW + SOIL + some audio library. For full-blown 3D, I'd say try either OGRE or Irrlicht + Irrklang (there are probably loads of others too).
In Java, there's at least Slick2D, Golden T Game Engine and for lower level access, LWJGL (although I think you can access LWJGL via Slick2D also). For 3D, someone recommended jMonkeyEngine to me, but I've never tried it.
I would vote for C++ for the simple fact that you have a dependable destructor in your objects. This lets you wrap many of the OpenGL components (buffers, textures, etc.). You can know that when the object is created, the asset is allocated, and when the object is destroyed (or goes out of scope), the asset is cleaned up.
It certainly can be done in Java. Minecraft was made in Java, and it has pulled in over $25 million.
Java has been proven to be just as fast if not faster than C++, though granted, you don't achieve such results without a little parameter tweaking and careful monitoring of the garbage collector. If you want to pursue game design with Java, I'd say that's a good choice to make, provided you study up on how to approach it first.
I'd go with C++, SDL, and OpenGL.. SDL is getting revamped with 1.3 at the moment, and it will be really good. In my opinion you should do it in C++ as you have stated you would feel more comfortable with Java, being comfortable after making a game in C++ would be very beneficial. You would not only make a game, but learn more at the same time.
If you go down the Java route you may need to ship the JVM along with your game. That's not to say don't do it but many people may not have Java installed or not have a recent enough version for the features and performance that you want. I haven't looked into the licensing requirements for shipping the JVM but that's probably something you'll want to investigate before making the decision.
You should also be aware that when highly tuning an app that although the Java API is the same across platforms that there are differences because the implementations of those often use the underlying OS. So I doubt that using Java would reduce the test burden at all for a game.
It really depends on what language your most used to. There's a steeper learning curve with c++ than with java. If you not into none of the languages, and is eager to get some development done I would recommend java.
And a little side note. If you totally new I would also recommend looking at XNA, but it's based on DirectX. And you have to know some C#.
Well I've programmed all my games in SDL and I would definitely recommend using c++. Though you may want to look at SFML!
http://www.sfml-dev.org/
SFML is already integrated with OpenGL, and it's fairly easy to get up and running with game programming.
It really depends on what kind of games you want to build and which programming language your more comfortable with.
If your planning to make big games in the future , C++ is best for overall experience. Most commercial games are written in C/C++. Microsoft also has XNA framework which uses C#
Id still go with the programming language your more convenient with, they are both great
However, if you dont mind learning a bit more then go with C++

For improving my programming skills I want to follow "learn a new language a year". What we can learn in 2011

I want to learn a new programming language in 2011. I am a java progmrammer, with not more than a year experience. I want to learn something which is really new and exciting, but not related to mobiles (iPhone, Android, iPad, Symbian).
I would suggest that you should give Scala a try.Its a language which runs on JVM and it is very much like Java syntactically,so you can easily pick up.Python is another good option.
Learn Rich Internet Application development (RIA). This is "new and exciting", especially if you don't care about mobile stuff. This means (and both of these primary languages, C# and ActionScript, are similar enough to Java that you'll easily meet your 1 year goal):
Silverlight / WPF Language=C# and xaml (Microsoft has come a long way in a short time with this and the quality of the tools in comparison to what's out there for Java/Flex stuff is impressive.)
Adobe Flex Language=ActionScript and mxml (If you want to stay in Java this is probably your better choice. For the record, Java/Flex is my primary skill set and has been for years, but as I've said above, their .NET equals are very attractive nowadays and I'm starting to learn C#/WPF/Silverlight now as a result.)
(JavaFX perhaps also, but I've never used it and it's widely not considered as mature as the other two.)
Techs like these are very well suited to controlled environments such as the business world (internal intranets) where it's easy to push out Flash player or Silverlight to all workstations you need it on. (So it's nice on a resume if you're job seeking.) In the Internet world it's a little more iffy, but still not too bad since deployment rates for Flash 9+ are pretty good now, and Silverlights are quickly rising as well.
"AJAX" and all it's dependent "stuff" (DHTML, DOM, CSS, etc etc) is common, but I wouldn't consider it new or particularly exciting. It's a bigger deal in the mobile scene where a lot of hardware either can't run more advanced virtual machine environments or they're intentionally crippled in an attempt to prevent this (Apple products).
Google created a new language this year called "Go". You could give that a try.
From the Go home page:
The Go programming language is an open
source project to make programmers
more productive. Go is expressive,
concise, clean, and efficient. Its
concurrency mechanisms make it easy to
write programs that get the most out
of multicore and networked machines,
while its novel type system enables
flexible and modular program
construction. Go compiles quickly to
machine code yet has the convenience
of garbage collection and the power of
run-time reflection. It's a fast,
statically typed, compiled language
that feels like a dynamically typed,
interpreted language.
http://golang.org/
I want to learn something which is really new and exciting, but not related to mobiles (iPhone, Android, iPad, Symbian).
How about something completely esoteric and not very useful, such as a Turing tarpit language like brainf**k?
Have a look at nodejs!
http://nodejs.org/
http://en.wikipedia.org/wiki/Nodejs
If you want to explore some new stuff but still be close to java, start learning Scala. It's a great JVM-based language, almost as fast as java, but with tons of new features. It mixes object-oriented and functional programming. Functional programming is gaining more popularity now, because of scalability and concurrency, so it's better to stay close to it. You can also learn about concurrency in a more natural way with Scala.
If you want to go into web-development, Ruby and Rails is a good choice.
Learn D, and if you really like it, help make the compiler better! D has practically every single feature you can think of, and then some (you can read about it on the website, I won't list things here), and it's much more powerful than C++ in some ways (it certainly isn't less powerful in any way except--maybe--for the lack of multiple inheritance, which I personally don't like anyway). The only thing it really lacks right now is a good, bug-free compiler, but for the most part it's just purely amazing. Just look at its features and you'll see. :)
jQuery, what about platforms such as AJAX and MVC? Kind of depends on what you already know and which platforms you're targeting.
I find visual material much more appealing to learn from, like video tutorials, etc. But theres tons of stuff, like reading tons of blogs, or if u dont have the time, download the pod cast so you listen on your way work (which what I sometimes do).
Basically you have to be displined in making time to learn, and you will always be on top of most things.
Sk8tz

Game Programming as Hobby, should I use Java or C++ [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
Presently, i am learning Java from the book The Art and Science of Java and following Standford's Programming Methodology Course.
I would like to do game programming, but only as a hobby.
I was thinking, would Java be a good choice or is C++ the defacto in game programming.
Since you are learning Java i would recommend that you stick to it.
If you are only developing games for fun, it won't really matter what language you use.
That depends, do you want to learn more about C++? Do you need to know? There's still OpenGL libraries in Java that are available, and the concepts would essentially be the same regardless of what language you work in. If it's just for a hobby then I can't see anything wrong with working in Java. In terms of speed however, lower-level languages are prefered.
Either would be fine. For a hobby, they both have pretty good low-level support for graphics etc, and both also have pretty good higher-level libraries for games (jMonkey engine, SDL, SFML, Ogre and many more).
You could also consider other languages too. Python has SDL bindings called PyGame. C# has the XNA framework which has several books published for it now to help learning the framework. SFML has bindings for C++, C, D, Ruby and I think Python. All of these are then suitable for creating games in. Just pick a language and off you go.
If you ask me, neither Java or C++ are fun languages. Both of them have a number of advantages but if you're doing it for fun and don't have deadlines, I would seek out a language that's more fun. Like Python, or something similar.
If you want to make games you really need a game platform as well as a language, otherwise you will spend all your time solving basic problems like how to draw a sprite to the screen, rather than concentrating on building a fun game.
Great choices for hobby games development are:
Microft's XNA platform with C# language
Adobe's Flash with ActionScript language
Sun's JavaFX platform with JavaFX script language
Unity3D with C# language
Ogre with C++ language
You can write games using both languages but I think you should really try C++. There are far more high-level libraries and game engines written in C++ than Java so it would be easier to find one that suits your needs. Not to mention that a lot of older games have been open sourced and you can freely download them and study the code. You can guess what language they're using ;)
Also you'll find a lot more tutorials and books that teach game programming using C/C++.
No matter what you choose in the end, have fun writing your games :)
If you go with Java, I recommend Computer Graphics for Java Programmers, by Leen Ammeraal.
If you were developing commercial games you would be using libraries rather than implementing these algorithms yourself, but it's easier once you know the fundamentals, which you can learn from a book like this one.
I once wrote a software renderer for a DOOM clone in Java, and having this book for reference helped a lot.
C++ is THE defacto language not only for game development but for pretty much everything else, including the browser you are using along with the OS it runs on.
So if you are considering ever getting serious with programming C/C++ should be top at your list.
As for speed C++ IS generally fast than Java.
Why generally?Well, the truth is that C++ is faster than Java, is faster than pretty much everything else actually, but sometimes C++ code can be poorly written and Java may prevent beginners to make some mistakes resulting in many of the claims that Java is as fast as 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 a framework (Java, .NET, VB, etc) will ever run faster than a program that runs on a lower level (direct on the OS or even the hardware) like C/C++, ASM, Pascal and so on.
Take a look at this:
Poorly written C++ half the speed of Java, properly written is much faster
At the end of the day you should go with the language that you feel more comfortable with, remember that python is enterprise ready, commercial, stable, great for beginners, awesome to use on "Web 2.0" projects not to mention that is a lot of fun too.
Java - I'd recommend sticking to one and getting good at it. The ideas remain the same, and as you learn more about a single language, you'll begin to learn about the drawbacks and advantages that are prevalent in many of the programming methodologies and languages today.
Even if you never intend to get into professional game development there is one big advantage to C++, which is that you have a lot more resources available. There are more books, more tutorials online, more open source examples to look at and more people who will be able to answer your questions on sites like gamedev.net.
I have developed a couple of small games in both C++ and Java and I would select C++ everytime. It gives you the low level control which you just dont get with java. But games development is a whole different beast. So if you are looking to learn games developement start in something you are comofrtable with
If you think you may one day want to work in the industry, you should learn C++. C++ is used to make pretty much all commercial games that run on PC/xbox/ps3. I assume wii is the same but don't know 100%, I never worked on wii.
The games studio I used to work at (before it got shut down) used C++ for the game (small parts used C and assembler) and was starting to use C# for tools.
If it will only ever be a hobby, then it doesn't really matter what language you use.
I would suggest to try Haaf's Game Engine for C. It is very very simple 2D engine with good documentation, tutorials and examples, runs on Windows 98 and above and it is ABSOLUTELY free even for commercial usage!
If you're completely new to game development, it's right for you IMHO.
Only a hobby? If you're using Java then Java. But first, what are you programming, 2-D or 3-D games? Java does both, and it's my game programing language, but I'm doing only 2-D programs. C++ is the defacto standard for serious game programming, especially commercial games.
Java has a great IDE called Eclipse, which, to me, is worth doing Java all by itself...Eclipse rocks! And it's free.
C# - no. Way too Microsoft dependent.
Btw, Java will work as an applet and as an application if you plan it well, the application runnable on all three platforms...
So, think about it. Low investment, high quality tools, cross-platform. If you decide to get into C++, then that's okay too. At least you will have wet your toes for free...
;-)
Language defines target platform and public. Both Java and C++ have advantages and disadvantages. You will use same architectures and algorithms on any platform. If you know how to write a game in C++ it takes a little to write game in java (2 weeks for me http://madeinsoviets.net/).
Start learning game programming with C++ and some easy game engine (Ogre3D, irrlight) - much more information and tutorials.
Old topic but since people still read this i want to add my 2c since its unique
to this post.
Stick with java, its a great way to make games over c++ if your going to do it as a hobby
and by yourself for these 2 reasons.
10x less coding for the same results (albeit it runs about 5x
slower)
Android games, even mediocre ones will sell (a buck each) on the
marketplace. if you sell even one your going to feel huge pride!
(also java doesnt slow down over C++ on android because its JVM is
unique and runs against the API directly accessing hardware, which
is fantastic!)
If you are just doing it as a hobby, it probably doesn't matter. Just use whatever you are most comfortable so you can get into the swing of game programming. Once you get better, you might like to figure out what is the "best" language.
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 it is for general desktop gaming then definitely C++. If you want to deploy games over the net then flash might also be a good idea.
If you're planning to enter the industry (or maybe a day start to sell your game yourself), then you have to learn C++.
Java or C# are good choice to get to the point of creating game without worrying much about the machine (memory and speed). That's recommended for beginner, but I would personally start directly with C++.
If you're looking into game programming then C++ is the way to go. Sure Java will be good for certain games, but C++ is so much faster.
I've coded in Java before, and then started coding in C++. The time I've spent coding in C++ made me understand certain things that were heavily simplified in Java.
Depending on how much experience you have programming, I'd suggest to learn the basics of Java and then move on to C++.
If you start with Java, I recommend this book Physics for Game Programmers
In general, C++ is for real games.
Java has always been slow for me, whatever platform or program I use.
C# is better than Java, but not as good as C++.
Yes, there are exceptions, but the fact that they are so notable rather proves that C++ is just the way to go unless you really know what you're doing.

C, C++, Java, what is next and what will it look like? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
What do you think the next evolution of languages will look like?
You might assume C and C++ are being "phased out" and that Java/.Net/Python/whatever is an "advance" or the "next stop".
They are all used heavily (see the number C or C++ of tags on this site). The difference is that neither one is the lingua-franca of the programming world anymore. It used to be that the majority of apps were desktop or DOS apps on systems with very limited resources, furthermore all the major desktop APIs were written in C or C++. So everyone learned these.
Now its more complex. Languages are becomming more application specific. C/C++ for when performance is important. Scripting languages for when your main performance hit is db reads/writes. Java and .Net for generic, non-performance-critical desktop apps.
Its the same thing with computer or electrical engineering. In the past these were huge fields at the highest level of abstraction available. Now we have all sorts of higher levels of abstraction. Still, we need people to do this lower-level kind of engineering. They are still in demand. In the same manner, C will continue to be used in many environments, as will C++. You'd be crazy, for instance, to think that you could write a device driver in Java, you'd also be mildly crazy (but perhaps less so) to write a full fledged GUI app in C if you had the choice and ability to do it in Java or .Net.
Each tool has its purpose. I expect C, C++, and Java to evolve and continue to be used for new and legacy development.
I can't speak for C++ and Java, but C definitely ain't goin' nowhere...
It's pretty much unthinkable to write any kind of operating system kernel without most of it in C (well, you can use assembly language entirely if you are really stubborn :-P).
C is basically a thin wrapper of niceness around assembly language. It's so tightly coupled to a standard Von Neumann CPU architecture that no standard library or runtime is required to implement most of its features: pointers, character strings, automatic variables on the stack, integer arithmetic, etc.
For the same reasons, C is great for user-level applications that absolutely demand high performance, things like multiplying huge matrices or parsing complex languages. It may be a pain to write a parser in C, but the speed and efficiency advantages of manual memory management are hard to pass up...
Alan Kay once said "Actually I made up the term "object-oriented", and I can tell you I did not have C++ in mind."
He is working on changing the future of programming
"The real romance is out ahead and yet to come. The computer revolution hasn't started yet. Don't be misled by the enormous flow of money into bad defacto standards for unsophisticated buyers using poor adaptations of incomplete ideas." source
Well, I might add that Bjarne once said "There are only two kinds of languages: the ones people complain about and the ones nobody uses."
Languages evolve to fill a niche problem that is not covered by other languages.
Weather that language gets a foot hold and establishes itself is another question entirely and has a lot to do with popularity.
What comes next?
The problem I see that needs filling is multi-processors (or multi-cores). Currently all the popular languages have very limited ability to exploit the additional cores. Basically all current popular languages give the developer the very basic objects (threads/locks etc) to use the cores and then leave it up to the developer to try and exploit the parallelism available from multi-cores.
It would be a nice to have a language that abstracted away the concept of cores (even threads) and could automatically exploit the enherant parallelism available from multi-cores/multi-processor architecture. Unfortunately all these languages (that I know about) are still research projects at universities and are unlikely to see real adoption any time soon.
You imply that there was a progression C -> C++ -> Java.
That's a bit artificial, each language represents a method of solving problems and each language has inherent problem domains where it is efficient at solve a problem and other problem domains where that language would be a bad choice.
Personally:
I would never write a device driver with Java.
I would probably not write back-end web module with C (you probably can but not me)
etc.
C# ? -- oh, but that is Java :) (sorry, couldn't resist)
The next generation of languages is already here, Scripting ones. Its no mistake that Microsoft is working on the DLR (dynamic language runtime). I think the future will be interpreted (but JITted), dynamic languages that have few constraints and lots of flexibility.
Performance constraints for the majority of languages are not so important nowadays, or no-one would be writing Java or C# apps at all, but considering CPUs are super-fast, and RAM is cheap, we don't notice the inefficiencies of these higher-level designs (eg if you have a 1mhz cpu, you write your code in C, not C#. If you have a CPU running at 3Ghz, you write it whatever you like)
So.. Ruby, Python, "Dynamic-C#"... these are the future. When MS releases the DLR, expect a lot of interest in it, expect a lot of companies to start talking about programmer productivity as the most important part of most application development.
After that.... probably a GUI-driven system where you connect blocks together in a UML-a-like system and add properties to them that produces generated code.
I believe the answer is twofold.
First, client side applications are more and more implemented as browser based applications. To give a browser based application a look and feel comparable to rich desktop application you need something like Javascript. And if you followed the news a bit you see a tremendous effort towards speeding up the javascript implementation in browsers, and a flourishing ecosystem of libraries which help you create a responsive, intuitive GUI with javascript in a browser.
So, for GUIs I believe the future is Javascript.
For the backend, the server, I very much doubt that the near future has a scripted language in store. Server-side software tends to live for years and years, features added, bugs fixed and all. The language in which that is written needs to be not so much fast to write, but easy to read (maintain).
And scripted languages tend to be a bit more difficult to understand if you revisit your code after a year or two to fix that bug. That has (in my opinion) two primary reasons which will not go away in the short term:
IDEs have trouble giving hints with dynamic languages
In the context your working there is by definition less context information available; in Java you know you can only get type X. In a scripted language you should check all referencing code, not easy in a large project
These problems can be mitigated by using very experienced developers, but if, in the future, the only kind of usefull developer is a experienced one we won't need to hire inexperienced ones, which will give trouble in the future.
For those reasons I believe the next-gen server-side language is statically typed. And from the statically typed languages I think C# and Java have the best chances due to the enormous amount of usefull libraries available and the very readable nature of those languages.
As other have mentioned, languages tend to adapt around new technologies and trends. So in order to answer that question, you first have to look at the overall future of computers and see what languages are most suitable for these purposes.
For example, to use your language progression as an example, in the beginning (:-)) there was a need for a language that would make maximum use of the limited resources available, C fit the bill in that regard. As time went on, and the spectrum of software applications incresed there was a greater demand for OO based languages in order to facilitate software reuse, easier design etc. and C++ / Java became popular.
Currently, there is an increased drift in the industry towards server side components that do all the work with thin client UIs (i.e. browsers). So languages that cater for this demand are becomming more popular (Ruby, ASP/Java EE languages).
New languages will become popular when the technology that they are closest to become popular.
Personally (and this is guesswork), I think there is huge scope for a language that truly takes advantage of multi-core systems. This will mean having multi-threading built from the very start and will probably require a change in approach and thinking (like going from procedural to OO).
It's going on a couple years old now, but Tim Sweeney's The Next Mainstream Programming Language: A Game Developer's Perspective is an interesting cogitation on the subject.
What is the future of programming? Away from languages as we know them.
It's 2009 and we're still using text editors? With the project I'm a part of you can build entire applications simply by setting attributes. Outside of (mainly mathematical) expressions and string values, there's not a line of text anywhere.
One of the developers complained that "you can't print out the code," and I replied, "Would a company print out its entire accounting structure? Or would it print out the aspects it wants to see, such as Cashflow Statements and Balance Sheets?" It's only when we move out into new abstraction mechanisms that we can really move ahead.
The future of programming remains to be seen, but I think there are some exciting developments happening that will finally release us from the C/C++/Java harness we've had on for so long.
At some point programs will start writing their own programs making humans redundant as far as programming is concerned. The major disagreement is when this will happen.
If you follow only this branch of programming language history, I think one can write both JavaScript and C#, since they came after the three you mention, share a similar syntax, and took from the predecessors.
Others might mention D or Objective-C (they are already here, of course).
By next language, I suppose you mean "next successful", because there is almost a new language each month...
I think it will be a language with garbage collection, running on bytecode with Jit, highly portable.
I can't tell if it will be object-oriented or functional, with static or dynamic typing, but I would bet on a mix, like does the interesting Fan Programming Language.
Or maybe we are all wrong, it might just a natural language, with spoken or graphical interface: "Take the weather box of this page, change its color and this logo to that, and integrate in my page".
What would be great, in my opinion, is a language like C++ with a more compact definition, better standard library, native garbage collection, and native synchronization constructs. It should be usable by relative novices, but still provide facilities for experts to program in an efficient, low-level way when needed. I believe D meets most of these criteria, but it seems unlikely to me that it will take hold.
On the short term, I expect high level languages to become more powerful and more used. Perl 6 and Javascript 2.0 are good examples of what awaits us.
On the long term, functional languages might make it into the mainstream, but I expect that will not happen any time soon.
D language, especially the 2.0 version has learnt from Ruby, Python and lots of modern languages without keeping source compatibility with C, still allowing for raw access to the metal. The design decisions of this language are a perfect solution for next-generation system and general programming languages, with even functional programming and metaprogramming built-in.
The language question is in my opinion no either or. It allways depends on your application. And since languages have mostly a standard set of libraries that are well suited for this or that application. Languages are tied somewhat to a particular application field.
For Example:
C -> Device drivers
C++ -> Highperformance Computing
Java -> Server side programs (J2EE)
C# -> Server, Client(Silverlight, WinForm, WPF)
Ruby, Python, ... -> WebScripting (Serverside) and helper scripts
ECMAScript (Javascript) -> WebScripting (Clientside)
I think any of these languages are capable to solve any computing program (also performance wise since we have Jits) but they are not used in any field since it is not feasible to recreate every library for every language.
On thing that makes C and C++ special is, that there is a standard library but compared to the others it is a rather minimalistic standard library. To use those languages efficiently 3rd party (non-standard) libraries are needed.
So when choosing a language for a project you look for these things:
Are there the right libraries you can use in your project
Do you know the language
Is it efficient to programm in this language (look at brainfuck)
Does your team know and master the language?
The last thing is also do you like the language? At the end that is the biggest motivation to use this or that language.
So the next step in language evolution will be higher level libraries and concepts to be faster and more expressive. Examples are
Lambda expressions
Linq (C# feature to do sort of sql in the language)
functional programming
variable typing
dynamic typing
not particular language: better IDEs that assists the programmer
Important: Support for easy! parallelism (Axum, Nesl, orca, Chapel, ... ) Here list

Categories