Page 1 of 1
One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 2:57 am
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
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.
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 3:02 am
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.
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 3:29 am
by kaos78414
Holy hell. I... I have no words
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 3:35 am
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 ^&$%@!...."
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 3:37 am
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-
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 4:33 am
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.
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 11:56 am
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.
Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 3:30 pm
by hallsofvallhalla
That looks like my code. I like it

Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 4:23 pm
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

Re: One of the worst code files I have ever seen
Posted: Wed Mar 05, 2014 4:42 pm
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
