Minecraft removing obfuscation in Java Edition
361–370 of 478 posts
Re: Minecraft removing obfuscation in Java Edition
#362Earlier quoted context omitted.
I am currently being radicalised against OOP because of one specific senior in my team that uses it relentlessly, no matter the problem domain. I recognise there are problems where OOP is a good abstraction, but there are so many places where it isn't. I suspect many OOP haters have experienced what I'm currently experiencing, stateful objects for handing calculations that should be stateless, a confusing bag of meth…
> I recognise there are problems where OOP is a good abstraction, but there are so many places where it isn't. Exactly. This is the way to think about it, imo. One of those places is GUI frameworks, I think, and there I am fine doing OOP, because I don't have a better idea how to get things done, and most GUI frameworks/toolkits/whatever are designed in an OOP way anyway. Other places I just try to go functional.
OOP is a collection of ideas about how to write code. We should use those ideas when they are useful and ignore them when they are not.
But many people don't want to put in the critical thinking required to do that, so instead they hide behind the shield of "SOLIDD principles" and "best practice" to justify their bad code (not knocking on SOLIDD principles, it's just that people use it to justify making things object oriented when they shouldn't be).
Re: Minecraft removing obfuscation in Java Edition
#363It'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.
In 2004 I played an MMO game on a pirated server. The owner of the server somehow got a version of the server binary, and used a hex editor (!) to add new features to the binary over time. It's the closest I've ever see to someone literally being one of the hackers from Matrix, literally staring at hexadecimal and changing chars one at a time
Re: Minecraft removing obfuscation in Java Edition
#364Re: Minecraft removing obfuscation in Java Edition
#365Re: Minecraft removing obfuscation in Java Edition
#366Earlier quoted context omitted.
It is called packages. There is nothing on the modules as programming concept that requires the existence of functions as entity. Again, Smalltalk did it first, and is actually one of the languages on the famous GoF book, used to create all the OOP patterns people complain about, the other being C++.
In java, it has to be a class in a package. Packages are sane enough. That isnt the point.
https://en.wikipedia.org/wiki/Modular_programming
> Languages that formally support the module concept include Ada, ALGOL, BlitzMax, C++, C#, Clojure, COBOL, Common Lisp, D, Dart, eC, Erlang, Elixir, Elm, F, F#, Fortran, Go, Haskell, IBM/360 Assembler, IBM System/38 and AS/400 Control Language (CL), IBM RPG, Java, Julia, MATLAB, ML, Modula, Modula-2, Modula-3, Morpho, NEWP, Oberon, Oberon-2, Objective-C, OCaml, several Pascal derivatives (Component Pascal, Object Pascal, Turbo Pascal, UCSD Pascal), Perl, PHP, PL/I, PureBasic, Python, R, Ruby,[4] Rust, JavaScript,[5] Visual Basic (.NET) and WebDNA.
If the whole complaint is that you cannot have a bare bones function outside of a class, Java is not alone.
Predating Java by several decades, Smalltalk, StrongTalk, SELF, Eiffel, Sather, BETA.
And naturally lets not forget C#, that came after Java.
Re: Minecraft removing obfuscation in Java Edition
#367Earlier 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…
> that was actively encouraged by the design of the language.
Java hasn't changed that much since the "hellscape" 00s. Is it better now? Or what is specific to the language the encourages "the mess of DAOs and Factories"? You can make all of those same mistakes in Python, C# or C++. I have used Java for about 15 years now and I have never written any of that junky enterprise crap with a million layers of OO. > I never use interfaces or the like.
This is the first that I heard any disdain towards interfaces. What is there not to like?Re: Minecraft removing obfuscation in Java Edition
#368Earlier quoted context omitted.
It's very useful in C++, funnily enough. This is because I can have a non-templated interface base class, then a templated impl class. Then my templated impl header can be very heavy without killing my build times since only the interface base class is #included. Not sure if this is as common in Java.
Java uses type erasure which are very cheap in compile time but you cannot do things like t = new T(); // T is a template parameter class C++ uses reified generics which are heavy on compile time but allows the above.
> C++ uses reified generics
I was a C++ programmer for many years, but I never heard this claim. I asked Google AI and it disagees. > does c++ have reified generics?
> C++ templates do not provide reified generics in the same sense as languages like C# or Java (to a limited extent). Reified generics mean that the type information of generic parameters is available and accessible at runtime.Re: Minecraft removing obfuscation in Java Edition
#369I wonder if they'll ever just open source the Java Edition on GitHub. People will buy Minecraft on every platform it is released on, just like Skyrim.
I don't even think open sourcing Minecraft would hurt them financially. People don't buy Minecraft because that's the only way to play the game; it's not, it's easy to find ways to run Minecraft for free. The reason people buy it is to join servers. Most serious servers only allow players with valid paid Minecraft accounts to join, because it allows the server owner to ban people or otherwise keep track of people. I…
Re: Minecraft removing obfuscation in Java Edition
#370Earlier quoted context omitted.
Thankfully those days are not with us any more. Java has moved on quite considerably in the last few years. I think people are still too ready to use massive, hulking frameworks for every little thing, of course, but the worst of the 'enterprise' stuff seems to have been banished.
I hope you are right. I really do. But I have a hunch, that if I accepted any Java job, I would simply have coworkers, who are still stuck with "enterprise" Java ideology, and whose word has more weight than the word of a newcomer. That's one of the fears, that stops me from seriously considering Java shops. Fear of unreasonable coworkers and then being forced to deliver shitty work, that meets their idea of how the…
Here is a tiny interface that will do what you need:
@FunctionalInterface
public interface IPasswordChecker
{
bool isValid(String password);
}
Now you can trivially declare a lambda that implements the interface.Example:
const IPasswordChecker passwordChecker = (String password) -> password.length() >= 16;