Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  Share the worst code you have ever seen...  (Read 7379 times)
0 Members and 1 Guest are viewing this topic.
Offline Breakfast

Senior Member




for great justice!


« Reply #30 - Posted 2004-12-15 20:27:26 »

From a very early web application I wrote (that is funnily enough still working fine. It's not terrible code in itself, unlike the lines of string1+=string2, but the variable naming is a little unorthodox:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
public static int[][] swapTheSwippa(int[][] swippaswappa, int stop)
      {

      int start = getfromhere(swippaswappa);
      int[][] swuppaswuppa = new int[swippaswappa.length][4];
      if (start!=stop)
            {      
            for(int i=0; i<start; i++)            
                  swuppaswuppa[i] = swippaswappa[i];
            swuppaswuppa[start]=swippaswappa[stop];      
            for(int i=(start+1); i<=stop; i++)      
                  swuppaswuppa[i]=swippaswappa[i-1];      
            for(int i=stop+1;i<swippaswappa.length;i++)
                  swuppaswuppa[i]=swippaswappa[i];
            }
      else swuppaswuppa=swippaswappa;
           
      swuppaswuppa[start][3]=1;
      return swuppaswuppa;
      }
Offline Grazer

Junior Member




My other avatar is much more flattering.


« Reply #31 - Posted 2004-12-15 20:35:30 »

Quote
1  
2  
3  
4  
5  
Vector v = new Vector();
if(v != null)
{
.....
}


This may have come from an expert C++ programmer, where strange things happen when there's no memory, rather than just seeing an exception fly by.

Current Project: Easy Decal
Other Stuff: grlea online
Offline Raghar

Junior Member




Ue ni taete 'ru hitomi ni kono mi wa dou utsuru


« Reply #32 - Posted 2004-12-15 20:48:17 »

You never know how "new" was overloaded.

re  crystalsquid
Pairing? Ignoring lastest version of CPU? Oh dear, just again that ugly microoptimalizations for old CPU. It was a reason why Intel didn't improved it fast enough.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #33 - Posted 2004-12-16 00:33:22 »

1  
2  
3  
4  
5  
6  
7  
8  
if(!(user.equals(""))&&!(user.equals(" "))&&!(user.equals("  ")) 
&&!(user.equals("   "))&&!(user.equals("    "))
&&!(user.equals("     "))&&!(user.equals("      "))
&&!(user.equals("       "))&&!(user.equals("        "))
&&!(user.equals("         "))&&!(user.equals("            "))
&&!(user.length()>=10)&&!(user.equals("Bitte Namen eingeben"))){
      [...]
      }


What? Trim you say? Smiley

Stacktraces? We need no stinking stacktraces!
1  
catch (Exception e) { output.setText("ERROR"); }


(output is a JTextArea)

Ah well, he's still a newbe and promised to not do anything like that ever again Grin

弾幕 ☆ @mahonnaiseblog
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #34 - Posted 2004-12-16 07:58:26 »

For quite some time we've been seeing entries in a history log that just say "message".  I found the cause today, after uncovering code similar to the following:

1  
2  
3  
4  
5  
public void method(String message) {
  [...]
  statement.setString("message");
  [...]
}


Hmm...

Hellomynameis Charlie Dobbie.
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #35 - Posted 2004-12-16 11:45:10 »

Nope, wont do it.  Refuse to do it...will not post all of my code here!! Wink

My code for work isnt too bad..my game code is spaghetti.
What do you expect though, I studied Cellular Biology and Chemistry in college (university for those of you 'cross the pond).  LOL

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline crystalsquid

Junior Member




... Boing ...


« Reply #36 - Posted 2004-12-16 15:04:47 »

Quote
re  crystalsquid
Pairing? Ignoring lastest version of CPU? Oh dear, just again that ugly microoptimalizations for old CPU. It was a reason why Intel didn't improved it fast enough.

I like assembler & optimising at this level  Wink

If you know what you're doing you can usually double the speed of any decently large function (such as vector transform & perspectivise, software renderers etc.)

The insights from learning how to optimise can help you write C/Java code that runs at least 10% faster just by knowing a few tricks and how code is really translated - and once it becomes second nature then it doesn't cost any more development time - and done properly it rarely produces code that would appear in this thread Smiley

One clipping routine I came across had the comments:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
// its just a clip to the left...

// And then a clip to the ri-i-i-ight...

// You put the verts on your knees...

// And pull the bounds in ti-i-i-ight

// Do the nested thrusts...

// It'll drive you insa-a-a-ne

// Lets do the clipping again!

It's not big, & its not clever Smiley
Pages: 1 [2]
  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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (28 views)
2014-09-21 23:33:17

BurntPizza (64 views)
2014-09-21 02:42:18

BurntPizza (34 views)
2014-09-21 01:30:30

moogie (42 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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!