One of the worst code files I have ever seen

Keep it clean but fun.
Post Reply
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

One of the worst code files I have ever seen

Post by Jackolantern »

Every once in a while I poke around gamedev.net, and was interested that they created a "Code Horrors" section. In it I found this thread. Check out the link in the first post, and look at that monster. Now that is how you do not write code. The conversation over there just goes on for pages listing all the ways it is horrible :lol:

EDIT: Although I found it pretty interesting that few people mentioned the fact that the file has thousands of lines of code without a single comment.
The indelible lord of tl;dr
User avatar
Xaos
Posts: 940
Joined: Wed Jan 11, 2012 4:01 am

Re: One of the worst code files I have ever seen

Post by Xaos »

I opened it and I LITERALLY said, out loud, "oh what the f****" on reaction. Lol. That's how you know its bad, when your first reaction is to tell profanities.
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: One of the worst code files I have ever seen

Post by kaos78414 »

Holy hell. I... I have no words
w00t
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: One of the worst code files I have ever seen

Post by Jackolantern »

That was pretty close to my reaction, except mine was a bit more along the lines of:

"What is this? This isn't code. Ohh....holy $%#, what the ^&$%@!...."
The indelible lord of tl;dr
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: One of the worst code files I have ever seen

Post by Jackolantern »

Imagine starting a new job and your boss hands you this file and says "Hey, we need you to make the character slide a bit on the ground when they move". -stares blankly at code file and then explodes-
The indelible lord of tl;dr
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: One of the worst code files I have ever seen

Post by a_bertrand »

What is worse than a code without comments? It's a code with WRONG comments. Left overs of a good old time where the comment had sense but since then the code changed and the comments haven't been updated.

Honestly, I dislike comments like:

Code: Select all

// This function turn the player
function TurnPlayer(var angle)
{
// For loop to iterate the items
for(var i=0;i < player.items.length;i++)
{
// Now rotate the items
player.items[i].Rotate(angle);
}
}
Why I don't like those (forget the lack of tabs here, this was an example, and tabs in the field didn't worked)? Simple, they are useless, as the function names and the code is clear enough and give exactly the same info.
Creator of Dot World Maker
Mad programmer and annoying composer
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: One of the worst code files I have ever seen

Post by vitinho444 »

Hum... All i saw was blank lines, then i moved the page sideways.. and saw that 9 mile long indentation ... Holy hell ahaha.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
hallsofvallhalla
Site Admin
Posts: 12023
Joined: Wed Apr 22, 2009 11:29 pm

Re: One of the worst code files I have ever seen

Post by hallsofvallhalla »

That looks like my code. I like it :)
User avatar
OldRod
Posts: 1320
Joined: Sun Sep 20, 2009 4:26 pm

Re: One of the worst code files I have ever seen

Post by OldRod »

I jumped up to the top, so I could get the full effect... didn't look so bad... scrolling down, right, down, right, down, right... wow, that's a lot of nested if statements LOL

Hey, at least it's indented. Imagine that many nested ifs with no indentation :shock:
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: One of the worst code files I have ever seen

Post by Jackolantern »

It may be indented, but the author has still chosen to wage a personal war against correct whitespacing.
hallsofvallhalla wrote:That looks like my code. I like it :)
I'll pretend I didn't hear that lol :roll:
The indelible lord of tl;dr
Post Reply

Return to “Off-Topic”