## Spot the WTF

posted in Lame? Where?!
Published September 13, 2005
Advertisement
So i've run into a few WTFs in the code for my Lazteroids game. Below are the two biggest and most problem causing WTFs I've come across in my code. So, for your viewing plasure, here you go. Spot the WTF!

WTF #1:
Quote:
void Matrix4f::SetX(Vec3f *vec){	matrix[0] = vec->x;	matrix[1] = vec->x;	matrix[2] = vec->x;}void Matrix4f::SetY(Vec3f *vec){	matrix[4] = vec->x;	matrix[5] = vec->x;	matrix[6] = vec->x;}void Matrix4f::SetZ(Vec3f *vec){	matrix[8]  = vec->x;	matrix[9]  = vec->x;	matrix[10] = vec->x;}


Note: Apparently .cpp doesn't mean "C plus plus" ... it means "Copy and Paste Programming" ...

And, WTF #2:
Quote:
Vec3f &Vec3f::operator-(Vec3f &vec){	Vec3f _vec;	_vec.x = x - vec.x;	_vec.y = y - vec.y;	_vec.z = z - vec.z;	return vec;}


And there we have it. Proof that I'm an idiot :)
0 likes 3 comments

Comments

jollyjeffers
Quote:
Apparently .cpp doesn't mean "C plus plus" ... it means "Copy and Paste Programming"

[lol] I like it.

I've lost count of how many times I've shot myself in the foot copy-n-pasting while programming.

Almost think it'd be a neat feature of any IDE - forcefully block CTRL+C, CTRL+X and CTRL+V [smile]
September 13, 2005 02:00 PM
superpig
Be careful with that second one... you don't want to be returning a reference to an object that is about to disappear from the stack.
September 13, 2005 03:37 PM
Gaiiden
Quote:

Quote:

Apparently .cpp doesn't mean "C plus plus" ... it means "Copy and Paste Programming"

I like it.

Haha me too [smile] I'll have to remember that one
September 14, 2005 09:00 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Math is hard

1471 views

## uhh

1655 views

## lol

1415 views

## new gaem?!

1343 views

## GH Tourney

1481 views

## Guitar Hero

1446 views

## Beyond Hell

1409 views
Advertisement
Advertisement