Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  In one of many Java class files of a commercially release product, so many ints.  (Read 287 times)
0 Members and 1 Guest are viewing this topic.
Offline tom_mai78101
« Posted 2014-01-20 15:18:44 »

It's packed with so many variables, I cannot believe what I saw:

The first 100 lines:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.format.Time;
import android.util.FloatMath;
import java.lang.reflect.Array;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import javax.microedition.khronos.opengles.GL11;

public class c
  extends ac
{
  static final int[][] aM;
  static final float[][] aN;

//snipped...

   int A = 1000;
  int B;
  int C;
  int D;
  int E;
  int F;
  int G;
  int H = 12;
  int I;
  float J;
  float K;
  float L;
  float M;
  boolean N = true;
  boolean O;
  boolean P;
  float Q = -1.0F;
  float R = -1.0F;
  float S = -1.0F;
  float T = -1.0F;
  int U;
  float[] V = new float[9];
  float[] W = new float[9];
  float[] X = new float[10];
  float[] Y = new float[10];
  float[][] Z;
  bq[] a = new bq[14];
  boolean aA;
  int aB;
  int aC;
  float aD;
  float aE;
  float aF;
  float aG;
  float aH;
  float aI;
  int aJ;
  int aK;
  int aL;
  float[][] aO;
  float[][] aP;
  boolean aQ;
  int aR;
  int aS;
  boolean aT;
  int aU;
  float[][] aV;
  int aW;
  int aX;
  int aY;
  int aZ;
  float[][] aa;
  float[][] ab;
  float[][] ac;
  float[][] ad;
  int ae;
  boolean[] af;
  float[] ag;
  int ah;
  int ai;
  int aj;
  int ak;
  int al;
  int am;
  int an;
  int ao;
  int ap;
  int aq;
  int ar;
  int[] as;
  int at;
  int[] au;
  int av;
  float[] aw;
  float[] ax;
  int ay;
  int az;
  boolean bA;
  int bB;
  int bC;
  float bD;
  boolean bE;
  boolean bF;
  int bG;
  int bH;
  int bI;
  int bJ;
  int bK;
  int bL;
  int bM;
  int bN;
  int bO;
  int bP;
  int bQ;
  float bR;
  float bS;
  int bT;
  int bU;
  int bV;
  float[][] bW;
  float bX;
  float bY;
  float bZ;
  int ba;
  int bb;
  int bd;
  float[][] be;
  int bf;
  int bg;
  int bh;
  float bi;
  int bj;
  int bk;
  int[] bl;
  int bm;
  float[] bn;
  int bo;
  int bp;
  int bq;
  int br;
  int bs;
  int bt;
  int bu;
  int bv;
  int bw;
  int bx;
  int by;
  int bz;
  bq[] c = new bq[5];
  int cA;
  int cB;
  boolean cC;
  int cD;
  int cE;
  int cF;
  int cG;
  int cH;
  int cI;
  boolean cJ;
  int cK;
  int cL;
  int cM;
  int cN;
  int cO;
  int cP;
  int cQ;
  int cR;
  int cS;
  int cT;
  int cU;
  int cV;
  int cW;
  int cX;
  int cY;
  int cZ;
  int ca;
  int cb;
  boolean cc;
  int cd;
  int cf;
  int cg;
  int ch;
  int ci;
  int cj;
  int ck;
  int cl;
  int cn;
  boolean co;
  boolean cp;
  boolean cq;
  int cr;
  int cs;
  boolean ct;
  boolean cu;
  int cv;
  int cw;
  int cx;
  int cy;
  int cz;
  int da;
  int db;
  int dc;
  float dd;
  float de;
  int[] df;
  float dg;
  boolean dh;
  boolean di;
  boolean dj;
  boolean dk;
  int dl;
  bq[] e = new bq[1];
  bq[] g = new bq[2];
  final float[][][] m = { { { 0.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 1.0F, 100.0F, 2.0F, 100.0F, 3.0F, 100.0F, 100.0F, 100.0F, 101.0F, 100.0F, 102.0F, 100.0F, 200.0F, 100.0F, 201.0F, 100.0F, 202.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 203.0F, 100.0F, 205.0F, 100.0F, 232.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 213.0F, 100.0F, 229.0F, 100.0F, 300.0F, 100.0F, 329.0F, 100.0F, 330.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 222.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 207.0F, 100.0F, 210.0F, 100.0F, 217.0F, 100.0F, 219.0F, 100.0F, 220.0F, 100.0F, 221.0F, 100.0F, 225.0F, 100.0F, 228.0F, 100.0F, 230.0F, 100.0F, 302.0F, 100.0F, 303.0F, 100.0F, 309.0F, 100.0F, 310.0F, 100.0F }, { 407.0F, 100.0F, 408.0F, 100.0F, 409.0F, 100.0F, 412.0F, 100.0F, 413.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 231.0F, 100.0F, 304.0F, 100.0F, 421.0F, 100.0F, 422.0F, 100.0F, 423.0F, 100.0F, 424.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 219.0F, 100.0F, 220.0F, 100.0F, 233.0F, 100.0F, 234.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 312.0F, 100.0F, 313.0F, 100.0F, 314.0F, 100.0F, 315.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 303.0F, 100.0F, 400.0F, 100.0F, 401.0F, 100.0F, 402.0F, 100.0F, 403.0F, 100.0F, 0.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, 0.0F, 0.0F, 0.0F, 0.0F }, { 222.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 207.0F, 100.0F, 210.0F, 100.0F, 217.0F, 100.0F, 219.0F, 100.0F, 220.0F, 100.0F, 221.0F, 100.0F, 225.0F, 100.0F, 228.0F, 100.0F, 230.0F, 100.0F, 302.0F, 100.0F, 303.0F, 100.0F, 309.0F, 100.0F, 310.0F, 100.0F }, { 407.0F, 100.0F, 408.0F, 100.0F, 409.0F, 100.0F, 412.0F, 100.0F, 413.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 231.0F, 100.0F, 304.0F, 100.0F, 421.0F, 100.0F, 422.0F, 100.0F, 423.0F, 100.0F, 424.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 219.0F, 100.0F, 220.0F, 100.0F, 233.0F, 100.0F, 234.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 312.0F, 100.0F, 313.0F, 100.0F, 314.0F, 100.0F, 315.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 303.0F, 100.0F, 400.0F, 100.0F, 401.0F, 100.0F, 402.0F, 100.0F, 403.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 425.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F }, { 426.0F, 100.0F, 427.0F, 100.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F } } };
  int n;
  int o;
  int p;
  int q;
  int r;
  int s;
  int t;
  int u;
  int[] v = new int[2];
  int[] w = new int[2];
  int[] x = new int[2];
  int[] y = new int[2];
  long[] z = new long[2];
 


I'm really not expecting a released product to have ugly codes, unless this is the norm in the industry.
Offline Damocles
« Reply #1 - Posted 2014-01-20 15:27:43 »

#1 the Application works (obviously, else it would not have been released)
#2 you only see the obfuscated code, so its guesswork if this is ugly code or has a very pragmatic reason to do so.

I have seen lots of very nice looking code, for projects that just dont work....

Offline opiop65

JGO Kernel


Medals: 154
Projects: 7
Exp: 3 years


JumpButton Studios


« Reply #2 - Posted 2014-01-20 15:30:10 »

If they need all the variables, then how is that a bad thing? And like Damocles said, the code was likely obfuscated anyway. The developer problem had better formatting and variable names. As long as your code works, and the developer understands what all variables do, why does it matter how many there are?

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Damocles
« Reply #3 - Posted 2014-01-20 15:34:37 »

Back in the JavaME days, very professional Game Companies tried to use as few Classes as possible,
for compatibility reasons with weaker devices.
The code looked messy from an OOP perspective, but there was a very good reason to do so.

The best solution is not the one that looks nicest (with a little flower on top), but the one that
results in the best stability of the application and understandability for the developer teams.

Plus: you have to also think about the situation that 2 or more Developers have to work simultaniously on the
same class. (that containes the redering logic or so)
In this case merging a list of altered variablenames is easier / less conflics for the sourcecontrol than merging
refactored class-files.
It really depends on the specific workflow during development.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!