0
\$\begingroup\$

Is there any specific reason why Java was the right choice for Minecraft?

\$\endgroup\$
9
  • 1
    \$\begingroup\$ Discussed on minecraft forums and very likely not fit for this site. minecraftforum.net/topic/… \$\endgroup\$ Jun 6, 2013 at 7:46
  • \$\begingroup\$ They just chose to use Java, probably because they were more familiar with it than for example C++. It most likely would run a lot better if it was coded in (proper) C++ \$\endgroup\$
    – user9790
    Jun 6, 2013 at 7:48
  • 6
    \$\begingroup\$ @JaakkoLipsanen And that's the point where discussion starts... \$\endgroup\$ Jun 6, 2013 at 7:55
  • 1
    \$\begingroup\$ Obviously it's because Mojang spend years learning every single programming language in existence, weighting their syntax, semantics and available solutions, libraries and frameworks. And after all of this he decided that Java was a best language for Minecraft… \$\endgroup\$ Jun 6, 2013 at 9:30
  • 5
    \$\begingroup\$ Why does it matter anyway? \$\endgroup\$ Jun 6, 2013 at 10:25

3 Answers 3

11
\$\begingroup\$

I saw a video from GDC 2012 where Markus "Notch" Persson said that he used Java because it's what he felt most productive in, at least at the time. It was only a passing comment though and note that this video is post-Minecraft, so his reasoning may not have been the same when he started Minecraft.

Source: "Back to the Garage: The Return of Indie Development" from about 14:45 in answer to the question "What Tools or Technology Would You Recommend?"

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Exactly this. Certain languages have drawbacks and advantages, but you write in what you're most comfortable in. \$\endgroup\$ Jun 25, 2014 at 17:38
4
\$\begingroup\$

A lot of people hate on Java, but honestly, modern Java is quite good. I mean, sure javac will never be as fast as a C/C++ compiler but if you take an in-depth look on how your Java code gets compiled into what eventually gets read by the JVM, you'll see why it's "slower."

Regardless, Java is a powerful and straight-forward language and I could speculate that he chose it both for the fact that he was comfortable with it and that he recognized that Java has platform-independence. That is, you can write your code (excluding native libraries you may be using) and compile it on that machine and it should be able to run on machines with different architecture, so long as they have the required JDK/JRE installed. And the way that Java handles networking-related tasks makes online(ish) games significantly easier to deal with. It also doesn't require you to explicitly handle all of your memory all of the time, something I find nice. Obviously, some people dislike that and, in all honesty, handling your memory 100% on your own is the "correct" way of doing it, but who does things the correct way these days? We have fast computers, let the garbage collector clean up our mess so we can focus on making fun games instead of the best way to handle dereferenced variables.

Here's some more thoughts, I like the second comment quoting John Carmack: https://stackoverflow.com/questions/1034458/why-arent-video-games-written-in-java

\$\endgroup\$
4
  • 3
    \$\begingroup\$ Sometimes java can really be faster than c++ because the JIT knows exactly what system its running on and can optimise for just that system whereas a C compiler must target a subset of systems \$\endgroup\$ Jun 21, 2013 at 11:07
  • 2
    \$\begingroup\$ @RichardTingle you do have a point, but an experienced C++ developer can run compiler flags that target specific processors, which makes the compiler take full advantage of those ops, just in the same way that a good jit runtime can. So it can't really be "faster", again it's about tuning the language you're writing in. \$\endgroup\$
    – user6484
    Jan 20, 2015 at 2:36
  • \$\begingroup\$ The fact that you can't even have functions at ALL in java, proves java is complete and utter garbage. How it become anymore than an esoteric research language is beyond me. \$\endgroup\$
    – MarcusJ
    Mar 24, 2017 at 21:18
  • \$\begingroup\$ @MarcusJ are you allright? Everything OK there buddy? \$\endgroup\$
    – Hobbamok
    Aug 14, 2019 at 14:34
1
\$\begingroup\$

That is a question for the "What If Machine" from Futurama unless they officialy say it somewhere you can never tell. From what I would say it might have been chosen due to the fact that Java is cross platform and it is very easy to install it on Windows, Mac or Linux.

The second reason; the reason I would choose, is the fact that he must have had previous experience with Java. He said that he had worked for king.com. Here is the possible explenation. So from what I understand, he simply dislikes C++.

https://mojang.com/notch/

Hello

My name is Markus Persson, and I'm a programmer. You can call me "Notch". If you want to, you can email me at [email protected]. Be warned that my spam filter eats far too many real emails, though. What I Do

I currently run my own company called Mojang Specifications, where I'm currently developing a game called Minecraft.

I used to work for Jalbum as a programmer. Or developer. Or code guru. We got to pick our own titles. :D

> Before that, I worked for King.com as a game programmer for 4.5 years. I wrote games like Funny Farm, Luxor, and Carnival Shootout. I mostly did actionscript programming there, but also some java for the game verification code. Recently, I've done some work in C++. It's a powerful language and fun, but the retarded compilation system makes me cry a bit.

I was one of the founders of a unique mmorpg called Wurm Online. I'm no longer active there. I also make music under the name Markus Alexei. It's electronica, and releases are very far apart.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ He used to write small Flash games for king.com, then decided to take a break to work on some solo projects. He liked Zach Barth’s Infiniminer, but Zach had it on the back-burner while he worked on SpaceChem, so Markus decided to make a his own sandbox game—Lego Group missed the boat even more than Zach. He was using ActionScript and Java at the time, so naturally he wrote the first version of CaveGame in that. Platform portability was a nice side-benefit. Changing later is hard. \$\endgroup\$
    – Synetech
    Oct 22, 2015 at 21:23

Not the answer you're looking for? Browse other questions tagged .