Jump to content

IC2 naming convention


Neowulf

Recommended Posts

Looking through the IC2 source.

Is the fact every local variable in all the member functions follows the naming convention var1, var2, var3... an artifact of the MCP decompile, or is it just Alblaka being weird/a jerk to poor newbie modders?

Link to comment
Share on other sites

Ahh, ok.

Pain in the arse trying to read through the crop crossing functions when there are 4 var#'s and he repurposes half of them every 20 lines of code or so.

I wouldn't put that kid of shit past Notch, but most of that is probably the compiler optimization re-using variables like they're virtual registers to conserve heap space (and make allocation to real registers easier at runtime). Local variables are the one thing that Java doesn't preserve very well from the source (and not really any reason to, considering).

Link to comment
Share on other sites

  • 1 month later...

I wouldn't put that kid of shit past Notch, but most of that is probably the compiler optimization re-using variables like they're virtual registers to conserve heap space (and make allocation to real registers easier at runtime). Local variables are the one thing that Java doesn't preserve very well from the source (and not really any reason to, considering).

Which is why I prefer to get the source files I really need from the developer if I can. Reading decompiled java code is a pain in the ass, especially when someone has a well documented piece of it on hand. Comments are insanely useful to understand many functions in a class, and how to implement them. Even self documented code without comments is easier to read and understand.

Link to comment
Share on other sites

Which is why I prefer to get the source files I really need from the developer if I can. Reading decompiled java code is a pain in the ass, especially when someone has a well documented piece of it on hand. Comments are insanely useful to understand many functions in a class, and how to implement them. Even self documented code without comments is easier to read and understand.

Congratulations on resurrecting an old thread to add nothing of value. While what you say is true, it is worse than useless in this situation, because Notch can't code and I barely consider him a programmer at all (more like a hobbyist and dabbler), gods know if he even comments in the first place (I doubt it), and all the compiler optimizations in the world aren't going to make well-structured code come out the other end like THAT.

I have decompiled quite a few programs in the past few months, just to better understand Java, and honestly I don't have much trouble at all reading it with the exception of losing the names of local scratch variables. The MCP folks do amazing work with de-obfuscating the code, and everything else can be laid squarely at the feet of Notch.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...