Earlier quoted context omitted.
One of the biggest optimizations it offers is shrinking the size of the classes by obfuscating the names. If you're obfuscating the names anyway, there's no reason that the names have to be the same length. "hn$z" is a heck of a lot smaller than "tld.organization.product.domain.concern.ClassName"
So we're not talking about runtime performance, but some minor improvement in loading times? I assume that once the JVM has read the bytecode, it has its own efficient in-memory structures to track references to classes rather than using a hash map with fully qualified names as keys
Minecraft removing obfuscation in Java Edition
271–280 of 478 posts
Re: Minecraft removing obfuscation in Java Edition
#272Earlier quoted context omitted.
[flagged]
One thing I always notice about this kind of post is that it never only has one accusation of oppressing a demographic group. There's always three of them at once. Makes it feel lightweight I think.
Re: Minecraft removing obfuscation in Java Edition
#273Earlier quoted context omitted.
> Most code bases don't need dynamically loaded objects designed with interfaces that can be swapped out. In fact, that functionality is nearly never useful. But that's how most people wrote Java code. Perhaps I'm not following, but dynamically loaded objects are the core feature of shared libraries. Among it's purposes, it allows code to be reused and even updated without having to recompile the project. That's pret…
We're talking about OO Java. You bring up shared libraries, list a bunch of things not unique to Java nor OO, then claim `etc.` benefits. You really haven't argued anything, so ending on a "you must be personally blind jab" just looks dumb.
Java I think gets attacked this way because a lot of developers, especially in the early 2000s, were entering the industry only familiar with scripting languages they'd used for personal hobby projects, and then Java was the first time they encountered languages and projects that involved hundreds of developers. Scripting codebases didn't define interfaces or types for anything even though that limits your project scalability, unit testing was often kinda just missing or very superficial, and there was an ambient assumption that all dependencies are open source and last forever whilst the apps themselves are throwaway.
The Java ecosystem quickly evolved into the enterprise server space and came to make very different assumptions, like:
• Projects last a long time, may churn through thousands of developers over their lifetimes and are used in big mission critical use cases.
• Therefore it's better to impose some rules up front and benefit from the discipline later.
• Dependencies are rare things that create supplier risks, you purchase them at least some of the time, they exist in a competitive market, and they can be transient, e.g. your MQ vendor may go under or be outcompeted by a better one. In turn that means standardized interfaces are useful.
So the Java community focused on standardizing interfaces to big chunky dependencies like relational databases, message queuing engines, app servers and ORMs, whereas the scripting language communities just said YOLO and anyway why would you ever want more than MySQL?
Very different sets of assumptions lead to different styles of coding. And yes it means Java can seem more abstract. You don't send queries to a PostgreSQL or MySQL object, you send it to an abstract Connection which represents standardized functionality, then if you want to use DB specific features you can unwrap it to a vendor specific interface. It makes things easier to port.
Re: Minecraft removing obfuscation in Java Edition
#274Earlier quoted context omitted.
So we're not talking about runtime performance, but some minor improvement in loading times? I assume that once the JVM has read the bytecode, it has its own efficient in-memory structures to track references to classes rather than using a hash map with fully qualified names as keys
The names need to be stored somewhere because they are exposed to the program that way
Re: Minecraft removing obfuscation in Java Edition
#275Earlier quoted context omitted.
One of the biggest optimizations it offers is shrinking the size of the classes by obfuscating the names. If you're obfuscating the names anyway, there's no reason that the names have to be the same length. "hn$z" is a heck of a lot smaller than "tld.organization.product.domain.concern.ClassName"
Yeah in some ways the obfuscation and mappings are similar to minification and sourcemaps in javascript.
Re: Minecraft removing obfuscation in Java Edition
#276Re: Minecraft removing obfuscation in Java Edition
#277Earlier quoted context omitted.
Not only working around proguard, but Minecraft mods are built on top of an incredibly cool and flexible runtime class file rewriting framework that means that each JAR can use simple declarative annotations like @Inject to rewrite minecraft methods on the fly when their mod is loaded or unloaded. This massively revolutionized mod development, which was previously reliant on tens of thousands of lines of manually com…
The devs for Java Edition really have mods in mind nowadays. - They left in the code debug features that they used to strip out. - They left in the code their testing infrastructure that they used to strip out as well. - They started making everything namespaced to differentiate contents between mods (like in this week's snapshot they made gamerules namespaced with the "minecraft:" prefix like items and blocks and wh…
Re: Minecraft removing obfuscation in Java Edition
#278"Minecraft: Java Edition" has been obfuscated since the release. No, It was obfuscated since around 1.8 when you (Microsoft) buy up Mojang Studios. before that? meh, It wasn't. That's the main reason why JE has broader mod ecosystem from the start., result being 1.7.2 being the one of the most active modded versions since most of them can't get passed to around 1.8. The motive behind this is probably due to them find…
You can easily see that versions prior to Beta 1.8 were obfuscated just by downloading the .jar for the older versions on minecraft.wiki.
You can even view some of the old MCP mappings here: https://archive.org/details/minecraftcoderpack
Re: Minecraft removing obfuscation in Java Edition
#279Earlier quoted context omitted.
That's why we use depedency injection now~~!
I've always wanted my editor's go-to functionality to take me to an abstract class instead of the place where the actual logic resides. Good times.
Re: Minecraft removing obfuscation in Java Edition
#280Earlier quoted context omitted.
You gotta admit, though, that a language which strongarms you into writing classes with hidden state and then extending and composing them endlessly is kinda pushing you in that direction. It’s certainly possible to write good code in Java but it does still lend itself to abuse by the kind of person that treated Design Patterns as a Bible.
>kind of person that treated Design Patterns as a Bible I have a vague idea of what the Bible says, but I have my favorite parts that I sometimes get loud about. Specifically, please think really hard before making a Singleton, and then don't do it.