One of the worst code files I have ever seen
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
One of the worst code files I have ever seen
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.
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
Re: One of the worst code files I have ever seen
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.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: One of the worst code files I have ever seen
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 ^&$%@!...."
"What is this? This isn't code. Ohh....holy $%#, what the ^&$%@!...."
The indelible lord of tl;dr
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: One of the worst code files I have ever seen
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
- a_bertrand
- Posts: 1536
- Joined: Mon Feb 25, 2013 1:46 pm
Re: One of the worst code files I have ever seen
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:
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.
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);
}
}
Creator of Dot World Maker
Mad programmer and annoying composer
Mad programmer and annoying composer
- vitinho444
- Posts: 2819
- Joined: Mon Mar 21, 2011 4:54 pm
Re: One of the worst code files I have ever seen
Hum... All i saw was blank lines, then i moved the page sideways.. and saw that 9 mile long indentation ... Holy hell ahaha.
- hallsofvallhalla
- Site Admin
- Posts: 12023
- Joined: Wed Apr 22, 2009 11:29 pm
Re: One of the worst code files I have ever seen
That looks like my code. I like it
Re: One of the worst code files I have ever seen
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
Hey, at least it's indented. Imagine that many nested ifs with no indentation
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: One of the worst code files I have ever seen
It may be indented, but the author has still chosen to wage a personal war against correct whitespacing.
I'll pretend I didn't hear that lolhallsofvallhalla wrote:That looks like my code. I like it
The indelible lord of tl;dr