Earlier quoted context omitted.
> The amount of vitriol Java receives in the game development space is rather strong. Java is a language with mandatory GC, tiny objects scattered around the heap (poor locality), and no value types or low-level memory access. This makes it very poor for games (you know, other very basic ones). But they're rapidly addressing these concerns.
> no value types or low-level memory access. i dont think you need value types at all, and you can simulate it by using byte buffers with an abstraction on top of it. After all, what's the difference between value types and a byte array? As for things like low level memory access - you also don't need that in most cases. Graphics libraries will give you enough access. And for any other case, you can always JNI into n…
Java Is Underhyped
291–300 of 808 posts
Re: Java Is Underhyped
#292Earlier quoted context omitted.
Yes, but that's my point. If I don't need performance, Python is ok. If I do, I won't go Java, I will choose something that is built for performance. Python is good enough for 99% of my performances need. The last 1%, jumping to java is not a big difference, I'll use rust or go. I won't use go for the ecosystem, but it's unique characteristics: easy concurrency, dead simple binary production. Java can't beat that. IF…
Java is orders of magnitude faster than Python for code that doesn't spend all of its time waiting for IO. Java perf and Go perf are about the same.
Re: Java Is Underhyped
#293Earlier quoted context omitted.
I think of Java as hitting an 'anti-sweet-spot': - It forces us to go through the ceremony and verbosity of static typing, yet blows away lots of the benefit by pervasive use of `null` and `Object`. Compare this to ML or Haskell, where there's less ceremony (Hindley-Milner type inference) yet more safety (no `null` or down-casting) - Checked exceptions have a similar ceremony and verbosity problem, yet the pervasiven…
> pervasive use of `null` and `Object` Who is pervasively using Object? You are talking about a language that hasn't existed for a decade.
Since then I've defined a .has method which requires the argument to have the same type as the collection, which completely avoids such problems.
Re: Java Is Underhyped
#294Earlier quoted context omitted.
> The amount of vitriol Java receives in the game development space is rather strong. Java is a language with mandatory GC, tiny objects scattered around the heap (poor locality), and no value types or low-level memory access. This makes it very poor for games (you know, other very basic ones). But they're rapidly addressing these concerns.
> no value types or low-level memory access. i dont think you need value types at all, and you can simulate it by using byte buffers with an abstraction on top of it. After all, what's the difference between value types and a byte array? As for things like low level memory access - you also don't need that in most cases. Graphics libraries will give you enough access. And for any other case, you can always JNI into n…
The difference is a bit like coding in Java vs coding in assembler (more below in an example).
> The only reason java gets poor performance is the coder doing java is too used to producing garbage (or is too inexperienced to write high performance java code).
Read about Entity Component Systems, the leading architecture of high-performance game engines these days.
To do this in Java, with the implied memory locality, would basically mean storing your entire game state in bytebuffers, and constantly unpacking and packing them to do any operation on them. And when you unpack them if you unpack them to a random object in heap, you negate the entire purpose of the locality of a bytebuffer. So you somehow need to do the job raw, reading everything inline and putting it back inline, so you can stay on the stack.
I also doubt that the get/put calls you'd need to do to get/set every number would be free. So performance would probably end up quite terrible.
> you can easily avoid most performance problems in memory by pre-allocating and reusing memory by pooling.
If you make an object pool in Java you'll save on memory alloc/dealloc. You won't achieve memory locality, so your code will be much slower than languages where you can do that.
Re: Java Is Underhyped
#295> Java is fun to write, productive What the hell? I don't think we have the same definition for any of these words. I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Not t…
Other languages have other pains, for example I have physical revulsion against the version management hacks for python or ruby (rbenv and stuff like that - somehow hacking environment variables on the fly to manage multiple installations of the language).
Two years ago I wrote a small web app in Python and I found hosting very complicated, compared to Java. PaaS exist but are very expensive.
Re: Java Is Underhyped
#296Earlier quoted context omitted.
You can write verbose code in any language, but most other languages don't consider it normal to name a class LangDetectLanguageIdentifierUpdateProcessorFactory. (Random example from an open source framework.)
Eh, any sufficiently large or complex codebases will get ridiculously long names at some point. Here are some from a famous C API (Windows): CoMarshalInterThreadInterfaceInStream D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION RtlWriteDecodedUcsDataIntoSmartLBlobUcsWritingContext Or how about: GtkColorSelectionChangePaletteWithScreenFunc The alternative is things having names that aren't actually de…
Re: Java Is Underhyped
#297> Java is fun to write, productive What the hell? I don't think we have the same definition for any of these words. I know Java has changed quite a bit since Java 8 (Java 9 being the last version I used professionally before switching completely to Go), but I just can't write Java again, it's physical. When I want to try a new Java feature and think about writing the scaffolding code, my stomach actually hurts. Not t…
You can put it another way and say it doesn't feel good to write Java without JetBrains.
Re: Java Is Underhyped
#298Earlier quoted context omitted.
Well, if we create a desktop app, the Python + C bindings will be a better choice for my own project. Easier to dev, equivalent perfs, equivalent libs (and the QT Rad is excellent). Java does have android right now, although it has to share with ReactNative, Xamarin and flutter. Again, for different compromises.
So apparently Rust isn't that better than. Java also has the IDE ecosystem between Netbeans, Eclipse and all JetBrains offerings, with exception of Apple and Microsoft offerings.
You are trying to move the debate toward the quality of java, which is was never my point.
Re: Java Is Underhyped
#299Earlier quoted context omitted.
I write software in Java. I can't stand python - too wishy-washy. But my main complaint about Python is trying to use someone else's software. Then it degenerates into a maze of twisty little passages of trying to install the correct set of dependencies, not knowing where those files are installed (which makes it difficult on a cluster, as you may need to do the install on every node separately). Then you try using p…
Java is so much worse on this front. > with Java, you just dump the necessary jars into a directory, include them in the classpath, and it works. Ant, maven, or gradle, and then some jars, somewhere? What's the classpath and whats $JAVA_HOME for this project? Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs, sync the build system, sync the dependencies, configure runtimes an…
> Oh and now I have to make it work in the IDE too, click through a billion menus and dialogs,
You click "Project from existing sources" in IntellIJ and it will recognize both Maven and Gradle projects and just work?
Sync the dependencies? configure runtimes and classpaths? What? With Maven and Gradle? Your talking Ant here.
Re: Java Is Underhyped
#300But once you are through that painful process, there is no other ecosystem more stable than Java. Things don't move too fast and that's a good thing for production applications.
I do dislike the verbosity sometimes while doing something that would take just a few lines in python or ruby. But IntelliJ more than makes up for it.