Live data from Hacker News

Minecraft removing obfuscation in Java Edition

minecraft.net

261–270 of 478 posts

Re: Minecraft removing obfuscation in Java Edition

#261
post #137

Earlier quoted context omitted.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

For me, it's the fact that the mess of DAOs and Factories that constituted "enterprise" Java in the 00s was a special kind of hellscape that was actively encouraged by the design of the language. 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. It was terrible and taug…

As someone coding since 1986 it is always kind of interesting how Java gets the hate for something that it never started, and was already common in the industry even before Oak became an idea.

To the point that there are people that will assert the GoF book, published before Java was invented, actually contains Java in it.

Re: Minecraft removing obfuscation in Java Edition

#262

It's extraordinary to me that Minecraft is both the game that has the most robust mod community out there and that the modders were working from obfuscated, decompiled Java binaries. With elaborate tooling to deobfuscate and then reobfuscate using the same mangled names. For over a decade! What dedication.

Me too. Having only a vague familiarity with the game, I thought that mods were using some official plugin system. I had no idea that minecraft modders (presumably kids/teens?) were not only reverse engineering things but also creating an entire ecosystem to work around proguard.

Yeah you got it backwards. Mojang refused to add a modding API, because Notch knew that the community has more freedom the way things currently are.

Re: Minecraft removing obfuscation in Java Edition

#263
post #137

Earlier quoted context omitted.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

(Hi Andrew) It's the misuse of OO constructs that gives it a bad name, almost always that is inheritance being overused/misused. Encapsulation and modularity are important for larger code bases, and polymorphism is useful for making code simpler, smaller and more understandable. Maybe the extra long names in java also don't help too, along with the overuse/forced use of patterns? At least it's not Hungarian notation.

Objective-C says hello in extra long names are concerned.

> CMMetadataFormatDescriptionCreateWithMetadataFormatDescriptionAndMetadataSpecifications(allocator:sourceDescription:metadataSpecifications:formatDescriptionOut:)

https://developer.apple.com/documentation/coremedia/cmmetada...:)

Re: Minecraft removing obfuscation in Java Edition

#264
post #75

Earlier quoted context omitted.

The sounds maybe, but the music? If there's one game whose music I always turn off instantly it's Minecraft. Touhou Youyoumu Minecraft ain't.

Interesting, I love Minecraft's music. I do listen to it intentionally outside of the game, but it's not quite the same as having it suddenly start up during gameplay. The first I heard of someone "obviously turning off the music" was, I kid you not, yesterday, and now I'm hearing it for a second time today. Would woulda thunk!

I turn off the in-game music while playing. I prefer to listen to my own stuff, including video essays etc, but I do still enjoy a lot of the music, and I've listened to it standalone a decent amount. I would tend to the same in most sandbox games, like factorio

Re: Minecraft removing obfuscation in Java Edition

#265
post #54

Earlier quoted context omitted.

Back in 2010 Notch promised > Once sales start dying and a minimum time has passed, I will release the game source code as some kind of open source. https://web.archive.org/web/20100301103851/http://www.minecr...

Notch has said he would do many things and rarely follows through with them. I'm still waiting for 0x10c.

The only upside of that game was that I taught myself assembly because of it. Even though it never released

Re: Minecraft removing obfuscation in Java Edition

#266

Earlier quoted context omitted.

You can add the Flight Simulator series to the list, which spawned a vast ecosystem of add-ons, both free and commercial. I believe though, that what you actually need as a big or small company, is good game first and foremost; the engine is secondary. When the community around a game reaches a critical mass, the very small percentage of its members who have the skills to modify things becomes significant as well. Fo…

Not sure if I understand exactly what you mean by reified, but Minecraft has a ton of minigames based on server-side mods which clone other popular games. Sometimes popular Minecraft minigames/mods even get implemented as standalone games. Battle royale games were almost certainly heavily inspired by the Minecraft minigame which predates them. Factorio has the old industrialcraft mod as an acknowledged inspiration. V…

Arent battle royale games inspired by things like The Hunger Games or Battle Royale? All the server minigames like that that I recall from back in the days were named something like Hunger Games

Re: Minecraft removing obfuscation in Java Edition

#267
post #137

Earlier quoted context omitted.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

> I can't imagine building something like a graphics framework without some subtyping. While React technically uses some OOP, in practice it's a pretty non-OOP way do UI. Same with e.g. ImGUI (C++), Clay (C). I suppose for the React case there's still an OOP thing called the DOM underneath, but that's pretty abstracted. In practice most of the useful parts of OOP can be done with a "bag/record of functions". (Though…

While using a OOP language.

    Welcome to Node.js v24.10.0.
    Type ".help" for more information.
    > const fn = (x) => x + x
    undefined
    > typeof(fn)
    'function'
    > Object.getOwnPropertyNames(fn)
    [ 'length', 'name' ]
    > fn.name
    'fn'
    > fn.length
    1
    > Object.getPrototypeOf(fn)
    [Function (anonymous)] Object

Re: Minecraft removing obfuscation in Java Edition

#268
post #137

Earlier quoted context omitted.

More proof that you don't need the source code to modify software. Then again, Java has always been easy to decompile, and IMHO the biggest obstacle to understanding is the "object-oriented obfuscation" that's inherent in large codebases even when you have the original source.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

  > I can't imagine building something like a graphics framework without some subtyping.
Let me introduce you to Fudgets, an I/O and GUI framework for Haskell: https://en.wikipedia.org/wiki/Fudgets

They use higher order types to implement subtyping as a library, with combinators. For example, you can take your fudget that does not (fully) implement some functionality, wrap it into another one that does (or knows how to) implement it and have a combined fudget that fully implements what you need. Much like parsing combinators.

Re: Minecraft removing obfuscation in Java Edition

#269
post #196
post #137

Earlier quoted context omitted.

First time I have heard of object-oriented obfuscation. I get it, but in general I don't get the OO hate. It's all about the problem domain imo. I can't imagine building something like a graphics framework without some subtyping. Unfortunately, people often use crap examples for OO. The worst is probably employee, where employee and contractor are subtypes of worker, or some other chicanery like that. Of course in th…

Tried to modify one boolean in a codebase a few weeks ago and I had to go thru like 12 levels of indirection to find "the code that actually runs".

tourist2d seems to have triggered some moderation trap, but wrote:

> Sounds like a problem with poor code rather than something unique to OOP.

And yeah, OO may lean a bit towards more indirection, but it definitely doesn't force you to write code like that. If you go through too many levels, that's entirely on the developer.

Re: Minecraft removing obfuscation in Java Edition

#270
post #166

Earlier quoted context omitted.

And there's no way to do only the optimisation part? Surely you could optimise without messing up class and method names..?

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
Post reply on HN