Hacker News new | past | comments | ask | show | jobs | submit login

To be honest, a lot of people have slammed the Minecraft codebase, claiming it's badly written and kind of a slow mess. I can't recall the citations, but based on the discussions when I read those aspects, I wouldn't put aspersions on Java alone in this case.



It was a one-man hobby project turned into one of the biggest video games. I doubt many codebases would work well after growing so far past their original aspirations.


It was never well-written, though. It was good enough to work, but it was never good code.


But it got the job done. That means way more than whether he used a factory or not.


I remember when I played it, there were many mods that optimized the game, usually offering over a 10x speedup with no noticeable difference in graphics or detail.

I definitely think that most of the speed increase is coming from the fact that Minecraft is being rewritten, and not which language it's being rewritten in.


I remember reading a blog post where somebody talked about how they severely decreased Minecraft's performance after refactoring and replacing function calls with separate X, Y and Z parameters to using a single Position object, which would of course in many instances have to be allocated on the fly. I can't seem to find it anymore, though.


Yes, something that should have at a minimum caused no harm to performance (and possibly helped, such as by allowing for SIMD) and been a win for code readability instead introduced an extra layer of pointer chasing and heap allocation, because Java doesn't have structs. See https://news.ycombinator.com/item?id=8485180


Indeed. They are adding value types though. It'll take years but once done, this kind of problem shouldn't crop up again. They've also been doing work on better escape analysis.

The JVM can do a lot of optimisations C++ apps don't benefit from, but I think the loss from not having value types more than drowns them out.


That's the one, thank you.


Sometimes you just have to get things done. The world probably wouldn't have Minecraft if the author had worried about "the proper way to architecture java code" that he read on some ranty blog somewhere.


Version 1.0 is always more sloppy than version 2.0, because with version 2.0, you have the luxury of 20/20 hindsight.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: