{"id":58,"date":"2009-05-05T19:29:50","date_gmt":"2009-05-05T17:29:50","guid":{"rendered":"http:\/\/www.speedrungames.com\/?p=58"},"modified":"2018-02-26T12:06:31","modified_gmt":"2018-02-26T10:06:31","slug":"java-in-game-development","status":"publish","type":"post","link":"https:\/\/www.speedrungames.com\/?p=58","title":{"rendered":"Game Development In Java"},"content":{"rendered":"<p>Hey guys, \ud83d\ude42 Grappling Hook is written entirely in Java and based on the jMonkeyEngine, which is also a written in Java. I want to explain a bit, why I think that Java is currently one of the best programming languages for game development.<\/p>\n<h2>1. Java Is Fast<\/h2>\n<p>Yes, that is the truth. Many people think that Java is slow, because it was, in the beginning. But things have changed and when you look at current <a href=\"http:\/\/shootout.alioth.debian.org\/gp4\/benchmark.php?test=all&amp;lang=all&amp;box=1\">benchmarks<\/a> Java is in average only twice as slow as C\/C++.<br \/>\nWhen you want to make Crysis 3, then it would be no option to write the entire game and engine in Java. But competing with huge companies like Crytek, Epic or ID Software makes no sense for a small indie team at all, from my point of view.<\/p>\n<h2>2. Eclipse Rocks<\/h2>\n<p>I had to work a long time with Visual Studio and also tried some other IDEs and text-editors, but none of them was such a good, stable and helpful tool as Eclipse is for me.<br \/>\nRight now Grappling Hook has more than 100 source code files so I need a good tool, which supports me. Code completion, syntax-highlighting, refactoring and a powerful search function are essential for a high development speed.<br \/>\nAnd this features work perfect in Eclipse, not like e.g. IntelliSense in Visual Studio for C++. While working on one big project I had to delete the IntelliSense database every day by hand to make it working again.<\/p>\n<h2>3. Extensive And Stable Library<\/h2>\n<p>In game development you need different kinds of data structures and containers, like linked lists, vectors, trees&#8230; You also play much around with strings and need many mathematic functions. In the Java library all this and much more waits for you. You don\u00b4t have to search new libraries for all this basic stuff.<br \/>\nMost of it is has also a good interface and is easy to use. In the current Java version you didn&#8217;t even have to care about iterators and can use them like in Python:<br \/>\nfor( Element e : list) {<br \/>\n\/\/ Do something with the element e<br \/>\n}<br \/>\nThats really nice, because I iterate a lot through different kinds of data structures. ( But be careful doing this every frame multiple times, because every iteration needs a new iterator-object. )<\/p>\n<h2>4. Managed Memory<\/h2>\n<p>I am not the best C++ programmer and destroyed the stack of my applications multiple times. It took me hours to track the problem and in some cases I didn&#8217;t find it at all. In Java and every other language with managed memory you simply don\u00b4t have such problems.<br \/>\nMemory leaks are also not that bad, because of the garbage collection. Garbage collection doesn&#8217;t mean that you have no memory leaks at all, but they are not such a bit issue and with the built in memory profiler they are easy to track.<\/p>\n<p>There are many other small points, why a like Java for game development, but that were the most important.<br \/>\nJava is not my favorite programming language for every task, but in game development I am 4 to 6 times faster than with C++. And being able to develop fast is very important to me.<\/p>\n<p><strong>What is your favorite programming language for game development and why?<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey guys, \ud83d\ude42 Grappling Hook is written entirely in Java and based on the jMonkeyEngine, which is also a written in Java. I want to explain a bit, why I think that Java is currently one of the best programming languages for game development. 1. Java Is Fast Yes, that is the truth. Many people [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[11,7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/posts\/58"}],"collection":[{"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=58"}],"version-history":[{"count":9,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":705,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=\/wp\/v2\/posts\/58\/revisions\/705"}],"wp:attachment":[{"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.speedrungames.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}